Skip to content

Commit

Permalink
Update syn and add macro call test
Browse files Browse the repository at this point in the history
  • Loading branch information
miam-miam committed Dec 15, 2023
1 parent 7bf0be0 commit 794e3b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions prse-derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ rust-version = "1.61.0"
proc-macro = true

[dependencies]
syn = { version = "2.0.4", default-features = false, features = ["parsing", "derive", "proc-macro", "clone-impls", "printing"] }
quote = "1.0.21"
proc-macro2 = "1.0.47"
syn = { version = "2.0.41", default-features = false, features = ["parsing", "derive", "proc-macro", "clone-impls", "printing"] }
quote = "1.0.33"
proc-macro2 = "1.0.70"
itertools = "0.12.0"

[features]
Expand Down
5 changes: 5 additions & 0 deletions tests/test-std/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,18 @@ mod tests {
try_parse!(line?, "{}")
}

fn try_macro_call(num: u8) -> Result<u32, prse::ParseError> {
try_parse!(format!("{num}{}", try_parsing()?), "{}")
}

fn option_parsing() -> Option<u32> {
Some(parse!("4\n3".lines().next()?, "{}"))
}

assert_eq!(5, pollster::block_on(async_parsing()));
assert_eq!(Ok(7), try_parsing());
assert_eq!(Some(4), option_parsing());
assert_eq!(Ok(77), try_macro_call(7));
}

include!("../common.rs");
Expand Down

0 comments on commit 794e3b0

Please sign in to comment.