Skip to content

Commit 2d864aa

Browse files
committed
JS: Add failing test
1 parent ca9b892 commit 2d864aa

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
| constants.js:12:27:12:31 | // OK | Error: analysis claims x >= 1_000 is always false |

javascript/ql/test/library-tests/RangeAnalysis/constants.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,8 @@ function f() {
66
if (two > one) {} // NOT OK - always true
77
if (two <= one) {} // NOT OK - always false
88
}
9+
10+
function underscores(x) {
11+
if (x >= 1_000_000) return; // OK
12+
if (x >= 1_000) return; // OK
13+
}

0 commit comments

Comments
 (0)