Introduce new test cases for hexadecimal and underscore parsing.
This commit is contained in:
parent
0c4e7ed9da
commit
0ea11a4d13
|
@ -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![]);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue