Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1287)

Unified Diff: tests/compiler/dart2js_extra/truncation_errors_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/compiler/dart2js_extra/truncation_errors_test.dart
diff --git a/tests/compiler/dart2js_extra/truncation_errors_test.dart b/tests/compiler/dart2js_extra/truncation_errors_test.dart
index 1e3767cf06444f4f05aca4a1d59021d61f2f0ce9..18105d82a30a8157c134419d8ff3bd3d0eea2160 100644
--- a/tests/compiler/dart2js_extra/truncation_errors_test.dart
+++ b/tests/compiler/dart2js_extra/truncation_errors_test.dart
@@ -7,7 +7,8 @@
import 'package:expect/expect.dart';
-@NoInline() @AssumeDynamic()
+@NoInline()
+@AssumeDynamic()
confuse(x) => x;
void find1(expected, thunk) {
@@ -19,11 +20,10 @@ void find1(expected, thunk) {
exceptionText = '$e';
}
if (exceptionText == null) {
- Expect.fail(
- 'Expected exception containing "$expected", returned: $returned');
+ Expect
+ .fail('Expected exception containing "$expected", returned: $returned');
}
- Expect.isTrue(
- exceptionText.contains(expected),
+ Expect.isTrue(exceptionText.contains(expected),
'Expected "$expected" in "$exceptionText"');
}
@@ -35,85 +35,58 @@ void find(expected, [thunk1, thunk2, thunk3, thunk4]) {
}
main() {
-
var NaN = double.NAN;
var Infinity = double.INFINITY;
- find(' Infinity: 123 ~/ 0',
- () => confuse(123) ~/ confuse(0),
- () => confuse(123) ~/ 0,
- () => 123 ~/ confuse(0),
- () => 123 ~/ 0);
-
- find('-Infinity: 123 ~/ -0.0',
- () => confuse(123) ~/ confuse(-0.0),
- () => confuse(123) ~/ -0.0,
- () => 123 ~/ confuse(-0.0),
- () => 123 ~/ -0.0);
-
- find(' NaN: NaN ~/ 123',
- () => confuse(NaN) ~/ confuse(123),
- () => confuse(NaN) ~/ 123,
- () => NaN ~/ confuse(123),
- () => NaN ~/ 123);
-
- find(' Infinity: 1e+200 ~/ 1e-200',
- () => confuse(1e200) ~/ confuse(1e-200),
- () => confuse(1e200) ~/ 1e-200,
- () => 1e200 ~/ confuse(1e-200),
- () => 1e200 ~/ 1e-200);
-
- find('NaN.toInt()',
- () => confuse(NaN).toInt(),
- () => NaN.toInt());
- find(' Infinity.toInt()',
- () => confuse(Infinity).toInt(),
- () => Infinity.toInt());
- find('-Infinity.toInt()',
- () => confuse(-Infinity).toInt(),
- () => (-Infinity).toInt());
-
- find('NaN.ceil()',
- () => confuse(NaN).ceil(),
- () => NaN.ceil());
- find(' Infinity.ceil()',
- () => confuse(Infinity).ceil(),
- () => Infinity.ceil());
- find('-Infinity.ceil()',
- () => confuse(-Infinity).ceil(),
- () => (-Infinity).ceil());
-
- find('NaN.floor()',
- () => confuse(NaN).floor(),
- () => NaN.floor());
- find(' Infinity.floor()',
- () => confuse(Infinity).floor(),
- () => Infinity.floor());
- find('-Infinity.floor()',
- () => confuse(-Infinity).floor(),
- () => (-Infinity).floor());
-
- find('NaN.round()',
- () => confuse(NaN).round(),
- () => NaN.round());
- find(' Infinity.round()',
- () => confuse(Infinity).round(),
- () => Infinity.round());
- find('-Infinity.round()',
- () => confuse(-Infinity).round(),
- () => (-Infinity).round());
+ find(' Infinity: 123 ~/ 0', () => confuse(123) ~/ confuse(0),
+ () => confuse(123) ~/ 0, () => 123 ~/ confuse(0), () => 123 ~/ 0);
+
+ find(
+ '-Infinity: 123 ~/ -0.0',
+ () => confuse(123) ~/ confuse(-0.0),
+ () => confuse(123) ~/ -0.0,
+ () => 123 ~/ confuse(-0.0),
+ () => 123 ~/ -0.0);
+
+ find(' NaN: NaN ~/ 123', () => confuse(NaN) ~/ confuse(123),
+ () => confuse(NaN) ~/ 123, () => NaN ~/ confuse(123), () => NaN ~/ 123);
+
+ find(
+ ' Infinity: 1e+200 ~/ 1e-200',
+ () => confuse(1e200) ~/ confuse(1e-200),
+ () => confuse(1e200) ~/ 1e-200,
+ () => 1e200 ~/ confuse(1e-200),
+ () => 1e200 ~/ 1e-200);
+
+ find('NaN.toInt()', () => confuse(NaN).toInt(), () => NaN.toInt());
+ find(' Infinity.toInt()', () => confuse(Infinity).toInt(),
+ () => Infinity.toInt());
+ find('-Infinity.toInt()', () => confuse(-Infinity).toInt(),
+ () => (-Infinity).toInt());
+
+ find('NaN.ceil()', () => confuse(NaN).ceil(), () => NaN.ceil());
+ find(' Infinity.ceil()', () => confuse(Infinity).ceil(),
+ () => Infinity.ceil());
+ find('-Infinity.ceil()', () => confuse(-Infinity).ceil(),
+ () => (-Infinity).ceil());
+
+ find('NaN.floor()', () => confuse(NaN).floor(), () => NaN.floor());
+ find(' Infinity.floor()', () => confuse(Infinity).floor(),
+ () => Infinity.floor());
+ find('-Infinity.floor()', () => confuse(-Infinity).floor(),
+ () => (-Infinity).floor());
+
+ find('NaN.round()', () => confuse(NaN).round(), () => NaN.round());
+ find(' Infinity.round()', () => confuse(Infinity).round(),
+ () => Infinity.round());
+ find('-Infinity.round()', () => confuse(-Infinity).round(),
+ () => (-Infinity).round());
// `truncate()` is the same as `toInt()`.
// We could change the runtime so that `truncate` is reported.
- find('NaN.toInt()',
- () => confuse(NaN).truncate(),
- () => NaN.truncate());
- find(' Infinity.toInt()',
- () => confuse(Infinity).truncate(),
- () => Infinity.truncate());
- find('-Infinity.toInt()',
- () => confuse(-Infinity).truncate(),
- () => (-Infinity).truncate());
-
+ find('NaN.toInt()', () => confuse(NaN).truncate(), () => NaN.truncate());
+ find(' Infinity.toInt()', () => confuse(Infinity).truncate(),
+ () => Infinity.truncate());
+ find('-Infinity.toInt()', () => confuse(-Infinity).truncate(),
+ () => (-Infinity).truncate());
}
-
« no previous file with comments | « tests/compiler/dart2js_extra/to_string_test.dart ('k') | tests/compiler/dart2js_extra/type_argument_factory_crash_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698