Add test involving non-builtin literal suffix

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
This commit is contained in:
David Tolnay 2021-12-27 18:43:50 -08:00
parent 917d940933
commit b8b6e4201b
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -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());
}