mirror of
https://github.com/dart-lang/sdk
synced 2024-09-06 00:59:09 +00:00
[tests] Make language/operators/left_shift_test work for web numbers
Change-Id: I6911a4b6e9d253c94257ccfed3d5d7451e812521 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/332491 Commit-Queue: Stephen Adams <sra@google.com> Reviewed-by: Mark Zhou <markzipan@google.com>
This commit is contained in:
parent
68af0bb004
commit
0a2141b134
|
@ -7,6 +7,8 @@ import "package:expect/expect.dart";
|
|||
main() {
|
||||
for (int i = 0; i < 80; i++) {
|
||||
var a = -1 << i;
|
||||
// web shifts produce a 32-bit unsigned result. Make it signed.
|
||||
if (webNumbers) a = a.toSigned(32);
|
||||
var b = -1;
|
||||
Expect.equals(1 << i, a ~/ b);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue