Skip to content

Invalid expectations with web number semantics in tests/corelib/unsigned_shift_test.dart #45419

@nshahan

Description

@nshahan

The following expectations in this test need to be rewritten. Currently we are losing coverage on the expectations because of the web number semantics. They should probably be rewritten without the loop and possibly in separate tests for VM and web platforms because the number semantics differ.

void testNonIntegerShifts() {
double n = 0.0;
n >>> 1; //# 01: compile-time error
for (dynamic number in [0.0, 1.0, 2.4, -2.4, double.infinity, double.nan]) {
if (number is! int) {
Expect.throws(() => number >>> 1); //# 07: ok
Expect.throws(() => 1 >>> number); //# 08: ok
}
}
}

On the web

value value is! int
0.0 false
1.0 false
2.4 true
-2.4 true
double.infinity false
double.nan true

@leafpetersen @rakudrama

Metadata

Metadata

Assignees

Labels

area-testCross-cutting test issues (use area- labels for specific failures; not used for package:test).area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions