mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
test(minifier): add tests for bigint string comparison (#541)
This commit is contained in:
parent
ea85ee9f2d
commit
db3ef449fc
1 changed files with 24 additions and 0 deletions
|
|
@ -229,6 +229,30 @@ fn test_bigint_number_comparison() {
|
|||
test_wcb("1n > null", "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_bigint_string_comparison() {
|
||||
test_wcb("1n < '2'", "true");
|
||||
test_wcb("2n > '1'", "true");
|
||||
test_wcb("123n > '34'", "true");
|
||||
test_wcb("1n == '1'", "true");
|
||||
test_wcb("1n == '2'", "false");
|
||||
test_wcb("1n != '1'", "false");
|
||||
test_wcb("1n === '1'", "false");
|
||||
test_wcb("1n !== '1'", "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_string_bigint_comparison() {
|
||||
test_wcb("'1' < 2n", "true");
|
||||
test_wcb("'2' > 1n", "true");
|
||||
test_wcb("'123' > 34n", "true");
|
||||
test_wcb("'1' == 1n", "true");
|
||||
test_wcb("'1' == 2n", "false");
|
||||
test_wcb("'1' != 1n", "false");
|
||||
test_wcb("'1' === 1n", "false");
|
||||
test_wcb("'1' !== 1n", "true");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn js_typeof() {
|
||||
test("x = typeof 1", "x='number'");
|
||||
|
|
|
|||
Loading…
Reference in a new issue