Skip to content

Commit

Permalink
Add test involving non-builtin literal suffix
Browse files Browse the repository at this point in the history
Currently fails:

    error: invalid width `256` for integer literal
       --> tests/test.rs:179:16
        |
    179 |         1 1i32 1u256
        |                ^^^^^
        |
        = help: valid widths are 8, 16, 32, 64 and 128
  • Loading branch information
dtolnay committed Dec 28, 2021
1 parent 917d940 commit b8b6e42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,11 @@ fn test_integer() {
let uusize = 1usize;

let tokens = quote! {
1 1i32 1u256
#ii8 #ii16 #ii32 #ii64 #ii128 #iisize
#uu8 #uu16 #uu32 #uu64 #uu128 #uusize
};
let expected = "- 1i8 - 1i16 - 1i32 - 1i64 - 1i128 - 1isize 1u8 1u16 1u32 1u64 1u128 1usize";
let expected = "1 1i32 1u256 - 1i8 - 1i16 - 1i32 - 1i64 - 1i128 - 1isize 1u8 1u16 1u32 1u64 1u128 1usize";
assert_eq!(expected, tokens.to_string());
}

Expand Down

0 comments on commit b8b6e42

Please sign in to comment.