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

Unified Diff: tests/corelib_2/from_environment_const_type_test.dart

Issue 2989643002: Migrate test block 8 to Dart 2.0. (Closed)
Patch Set: Merge Created 3 years, 4 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/corelib_2/from_environment_const_type_test.dart
diff --git a/tests/corelib_2/from_environment_const_type_test.dart b/tests/corelib_2/from_environment_const_type_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..3ed691cd868bbac3dd0a37ce3abf0842ab9420ec
--- /dev/null
+++ b/tests/corelib_2/from_environment_const_type_test.dart
@@ -0,0 +1,43 @@
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// SharedOptions=-Da=true -Db=false -Dc=3 -Dd=STRING
+
+import "package:expect/expect.dart";
+
+class Foo {}
+
+const
+ bool // //# 01: ok
+ int // //# 02: compile-time error
+ String // //# 03: compile-time error
+ Foo // //# 04: compile-time error
+ a = const bool.fromEnvironment('a');
+
+const
+ bool // //# 05: ok
+ int // //# 06: compile-time error
+ String // //# 07: compile-time error
+ Foo // //# 08: compile-time error
+ b = const bool.fromEnvironment('b');
+
+const
+ bool // //# 09: compile-time error
+ int // //# 10: ok
+ String // //# 11: compile-time error
+ Foo // //# 12: compile-time error
+ c = const int.fromEnvironment('c');
+
+const
+ bool // //# 13: compile-time error
+ int // //# 14: compile-time error
+ String // //# 15: ok
+ Foo // //# 16: compile-time error
+ d = const String.fromEnvironment('d');
+
+main() {
+ Expect.equals(a, true);
+ Expect.equals(b, false);
+ Expect.equals(c, 3);
+ Expect.equals(d, 'STRING');
+}
« no previous file with comments | « tests/corelib_2/format_exception_test.dart ('k') | tests/corelib_2/from_environment_const_type_undefined_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698