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

Unified Diff: tests/language/null2_test.dart

Issue 1411243003: Upgrade some tests to use annotations instead of 'clever' confuse() function (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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/language/null2_test.dart
diff --git a/tests/language/null2_test.dart b/tests/language/null2_test.dart
index 16d3a8308bfd7a64bdd72347190390aa0a52fcce..000eed68f12ef9002244b61b9eb38cad79dbadaf 100644
--- a/tests/language/null2_test.dart
+++ b/tests/language/null2_test.dart
@@ -5,16 +5,9 @@
import "package:expect/expect.dart";
-// Magic incantation to avoid the compiler recognizing the constant values
-// at compile time. If the result is computed at compile time, the dynamic code
-// will not be tested.
-confuse(x) {
- try {
- if (new DateTime.now().millisecondsSinceEpoch == 42) x = 42;
- throw [x];
- } on dynamic catch (e) { return e[0]; }
- return 42;
-}
+@AssumeDynamic()
+@NoInline()
+confuse(x) => x;
main() {
Expect.equals("Null", null.runtimeType.toString());

Powered by Google App Engine
This is Rietveld 408576698