Skip to content

Commit 6087191

Browse files
authored
chore: fix wrong float test (#2952)
1 parent 7322bfc commit 6087191

File tree

6 files changed

+2611
-2296
lines changed

6 files changed

+2611
-2296
lines changed

tests/compiler/number-warn.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"asc_flags": [
3+
],
4+
"stderr": [
5+
"AS907: 'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.",
6+
"AS907: 'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.",
7+
"AS907: 'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.",
8+
"AS907: 'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.",
9+
"AS907: 'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.",
10+
"AS907: 'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.",
11+
"AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.",
12+
"AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.",
13+
"AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.",
14+
"AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.",
15+
"AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.",
16+
"AS908: Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters."
17+
]
18+
}

tests/compiler/number-warn.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
// Should produce warnings
3+
4+
// always false
5+
(!(1.0 == NaN));
6+
(!(NaN == F32.NaN));
7+
(!(F64.NaN == 1.0));
8+
9+
// always true
10+
(1.0 != NaN);
11+
(NaN != F32.NaN);
12+
(f64.NaN != 1.0);
13+
14+
// always true
15+
(+.0 == -.0);
16+
(-.0 != -.0);
17+
(-.0 == +.0);
18+
(f32(+.0) == f32(-.0));
19+
(f32(-.0) != f32(-.0));
20+
(f32(-.0) == f32(+.0));

0 commit comments

Comments
 (0)