mirror of
https://github.com/crate-ci/typos.git
synced 2026-11-17 11:20:05 +01:00
test(cli): Show hex literal issue
This commit is contained in:
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
|
||||
@@ -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,
|
||||
},
|
||||
]
|
||||
|
||||
"#]]
|
||||
|
||||
Reference in new issue
Block a user