Introduce new test cases for hexadecimal and underscore parsing.

This commit is contained in:
KtorZ 2023-06-08 13:26:22 +02:00
parent 0c4e7ed9da
commit 0ea11a4d13
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
1 changed files with 30 additions and 0 deletions

View File

@ -3337,3 +3337,33 @@ fn brackets_followed_by_parenthesis() {
} }
"#}); "#});
} }
#[test]
fn int_parsing_hex() {
let code = indoc! {r#"
fn foo() {
let i = 0xff
}
"#};
assert_definitions(code, vec![])
}
#[test]
fn int_parsing_hex_bytes() {
let code = indoc! {r#"
fn foo() {
let bytes = [ 0x01, 0xa2, 0x03 ]
}
"#};
assert_definitions(code, vec![])
}
#[test]
fn int_parsing_numeric_underscore() {
let code = indoc! {r#"
fn foo() {
let i = 1_234_567
}
"#};
assert_definitions(code, vec![]);
}