Skip to content

Commit

Permalink
Add unit test to confirm negative integer literals work without quota…
Browse files Browse the repository at this point in the history
…tion marks

Fixes #244
  • Loading branch information
TedDriggs committed Feb 13, 2024
1 parent 3ee36d9 commit db0e40f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/src/from_meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,12 @@ mod tests {
assert_eq!(fm::<u32>(quote!(ignore = 5000i32)), 5000u32);
}

#[test]
fn negative_int_without_quotes() {
assert_eq!(fm::<i8>(quote!(ignore = -2)), -2i8);
assert_eq!(fm::<i32>(quote!(ignore = -255)), -255i32);
}

#[test]
#[allow(clippy::float_cmp)] // we want exact equality
fn float_without_quotes() {
Expand Down

0 comments on commit db0e40f

Please sign in to comment.