test(cli): Show hex literal issue

This commit is contained in:
Ed Page committed 2026-01-19 07:45:01 -06:00
1 parent 3cee018e3f
commit 5d4cfab739
3 files changed
+22 -5

No files matched your search

@@ -1,5 +1,5 @@
int main() {
uint8 i = 0;
uint8 i = 0x1afe23456UL;
std::countr_one(i);
return 0;
}
@@ -1,4 +1,11 @@
bin.name = "typos"
stdin = ""
stdout = ""
stdout = """
error: `afe` should be `safe`
╭▸ ./sample.cpp:2:18
│
2 │ uint8 i = 0x1afe23456UL;
╰╴ ━━━
"""
stderr = ""
status.code = 2
+13 -3
View File
@@ -1260,7 +1260,7 @@ mod test {
fn tokenize_ignore_hex() {
let parser = TokenizerBuilder::new().build();
let input = "Hello 0xDEADBEEF World";
let input = "Hello 0xDEADBEEF 0x1afe23456UL World";
let actual: Vec<_> = parser.parse_bytes(input.as_bytes()).collect();
assert_data_eq!(
actual.to_debug(),
@@ -1272,10 +1272,15 @@ mod test {
offset: 0,
},
Identifier {
token: "World",
token: "0x1afe23456UL",
case: None,
offset: 17,
},
Identifier {
token: "World",
case: None,
offset: 31,
},
]
"#]]
@@ -1291,10 +1296,15 @@ mod test {
offset: 0,
},
Identifier {
token: "World",
token: "0x1afe23456UL",
case: None,
offset: 17,
},
Identifier {
token: "World",
case: None,
offset: 31,
},
]
"#]]