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

Unified Diff: tests/kernel/unsorted/global_field_initializer_test.dart

Issue 2453773002: Reland "Merge more Kernel infrastructure from kernel_sdk SDK fork." (Closed)
Patch Set: Created 4 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/kernel/unsorted/global_field_initializer_test.dart
diff --git a/tests/kernel/unsorted/global_field_initializer_test.dart b/tests/kernel/unsorted/global_field_initializer_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..633ab8e99b8a28363e3cd912279725c1bc0530a8
--- /dev/null
+++ b/tests/kernel/unsorted/global_field_initializer_test.dart
@@ -0,0 +1,37 @@
+// Copyright (c) 2016, 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.
+
+import 'expect.dart';
+
+var intField = 1;
+var doubleField = 3.1415;
+var stringField = "hello";
+var nullField = null;
+var nullField2;
+var composed = "hello" + " " + "world";
+
+class A {
+ static var intField = 1;
+ static var doubleField = 3.1415;
+ static var stringField = "hello";
+ static var nullField = null;
+ static var nullField2;
+ static var composed = "hello" + " " + "world";
+}
+
+main() {
+ Expect.isTrue(intField == 1);
+ Expect.isTrue(doubleField == 3.1415);
+ Expect.isTrue(stringField == "hello");
+ Expect.isTrue(nullField == null);
+ Expect.isTrue(nullField2 == null);
+ Expect.isTrue(composed == "hello world");
+
+ Expect.isTrue(A.intField == 1);
+ Expect.isTrue(A.doubleField == 3.1415);
+ Expect.isTrue(A.stringField == "hello");
+ Expect.isTrue(A.nullField == null);
+ Expect.isTrue(A.nullField2 == null);
+ Expect.isTrue(A.composed == "hello world");
+}
« no previous file with comments | « tests/kernel/unsorted/getters_and_setters_test.dart ('k') | tests/kernel/unsorted/global_function_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698