diff --git a/crates/oxc_minifier/tests/closure/fold_constants.rs b/crates/oxc_minifier/tests/closure/fold_constants.rs index 71524e91d..ba76c1bd4 100644 --- a/crates/oxc_minifier/tests/closure/fold_constants.rs +++ b/crates/oxc_minifier/tests/closure/fold_constants.rs @@ -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'");