Skip to content

Commit c0db21d

Browse files
committed
Add another test case for hex overflow in ast verifier
Fixes #875
1 parent 9439780 commit c0db21d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Removed accidental random print to stdout when formatting a return statement across multiple lines ([#879](https://github.com/JohnnyMorganz/StyLua/issues/879))
2424
- Luau: Fixed incorrect removal of semicolon before compound assignment with parentheses leading to ambiguous syntax error ([#885](https://github.com/JohnnyMorganz/StyLua/issues/885))
2525
- Luau: Fixed incorrect collapsing of union/intersection type value with comments in a type table leading to a syntax error ([#893](https://github.com/JohnnyMorganz/StyLua/issues/893))
26-
- Fixed `--verify` panicing due to overflow for very large Hex numbers ([#889](https://github.com/JohnnyMorganz/StyLua/issues/889))
26+
- Fixed `--verify` panicing due to overflow for very large Hex numbers ([#875](https://github.com/JohnnyMorganz/StyLua/issues/875), [#889](https://github.com/JohnnyMorganz/StyLua/issues/889))
2727

2828
## [0.20.0] - 2024-01-20
2929

src/verify_ast.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ mod tests {
275275
assert!(ast_verifier.compare(input_ast, output_ast));
276276
}
277277

278+
#[test]
279+
fn test_equivalent_hex_numbers_very_large_number() {
280+
let input_ast = full_moon::parse("max = max or 0xffffffff").unwrap();
281+
let output_ast = full_moon::parse("max = max or 0xffffffff").unwrap();
282+
283+
let mut ast_verifier = AstVerifier::new();
284+
assert!(ast_verifier.compare(input_ast, output_ast));
285+
}
286+
278287
#[test]
279288
fn test_different_hex_numbers() {
280289
let input_ast = full_moon::parse("local x = 0xFFAA").unwrap();

0 commit comments

Comments
 (0)