Skip to content

Commit

Permalink
add tests for mozilla#1608
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Oct 5, 2024
1 parent cdee6cd commit 557ee56
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions rhino/src/test/java/org/mozilla/javascript/tests/BigIntTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,26 @@ public void parse() throws IOException {
assertEquals(stmt, root.toSource());
}
}

@Test
public void compareWithString() {
Utils.assertWithAllOptimizationLevelsES6(true, "9007199254740992n < '9007199254740993'");
Utils.assertWithAllOptimizationLevelsES6(true, "9007199254740992n <= '9007199254740993'");
Utils.assertWithAllOptimizationLevelsES6(true, "9007199254740993n <= '9007199254740993'");
Utils.assertWithAllOptimizationLevelsES6(true, "9007199254740993n == '9007199254740993'");
Utils.assertWithAllOptimizationLevelsES6(true, "9007199254740993n >= '9007199254740993'");
Utils.assertWithAllOptimizationLevelsES6(true, "9007199254740993n >= '9007199254740992'");
Utils.assertWithAllOptimizationLevelsES6(true, "9007199254740993n > '9007199254740992'");
}

@Test
public void compareStringWith() {
Utils.assertWithAllOptimizationLevelsES6(true, "'9007199254740992' < 9007199254740993n");
Utils.assertWithAllOptimizationLevelsES6(true, "'9007199254740992' <= 9007199254740993n");
Utils.assertWithAllOptimizationLevelsES6(true, "'9007199254740993' <= 9007199254740993n");
Utils.assertWithAllOptimizationLevelsES6(true, "'9007199254740993' == 9007199254740993n");
Utils.assertWithAllOptimizationLevelsES6(true, "'9007199254740993' >= 9007199254740993n");
Utils.assertWithAllOptimizationLevelsES6(true, "'9007199254740993' >= 9007199254740992n");
Utils.assertWithAllOptimizationLevelsES6(true, "'9007199254740993' > 9007199254740992n");
}
}

0 comments on commit 557ee56

Please sign in to comment.