Skip to content

Commit

Permalink
Merge pull request #700 from epage/debug
Browse files Browse the repository at this point in the history
docs(tutorial): Make some connections explicit for traces
  • Loading branch information
epage authored Jan 20, 2025
2 parents 5ffcd7c + 4ce70ca commit 6fc1187
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion assets/trace.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/_tutorial/chapter_8.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
//! # Chapter 8: Debugging
//!
//! When things inevitably go wrong, you can introspect the parsing state by running your test case
//! with `--features winnow/debug`:
//! with `--features winnow/debug`.
//!
//! For example, the trace output of an [escaped string parser][crate::_topic::language#escaped-strings]:
//! ![Trace output from string example](https://raw.githubusercontent.com/winnow-rs/winnow/main/assets/trace.svg "Example output")
//!
//! You can extend your own parsers to show up by wrapping their body with
Expand Down
2 changes: 1 addition & 1 deletion src/combinator/debug/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ fn example() {
.with_current_dir(current_dir)
.with_env("CLICOLOR_FORCE", "1"),
)
.test("assets/trace.svg", [cmd.as_str()]);
.test("assets/trace.svg", [format!(r#"{cmd} '"abc"'"#).as_str()]);
}

0 comments on commit 6fc1187

Please sign in to comment.