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

Unified Diff: pkg/fasta/test/expressions.dart

Issue 2631613003: Add Fasta tests. (Closed)
Patch Set: Address review comments. Created 3 years, 11 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
« no previous file with comments | « pkg/fasta/test/default_values.dart.outline.expect ('k') | pkg/fasta/test/expressions.dart.dartk.expect » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/fasta/test/expressions.dart
diff --git a/pkg/fasta/test/expressions.dart b/pkg/fasta/test/expressions.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9b1f55d0ec0a53d3c551f5fdaecfaaaaf7e3b2f0
--- /dev/null
+++ b/pkg/fasta/test/expressions.dart
@@ -0,0 +1,77 @@
+// 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.
+
+foo({fisk}) {
+ print(fisk);
+}
+
+caller(f) {
+ f();
+}
+
+main() {
+ int i = 0;
+ print(i == 1 ? "bad" : "good");
+ print("$i");
+ print("'$i'");
+ print(" '${i}' ");
+ print(" '${i}' '${i}'");
+ print(" '$i' '${i}'");
+ print("foo" "bar");
+ print(" '${i}' '${i}'" " '$i' '${i}'");
+ try {
+ throw "fisk";
+ } on String catch (e, s) {
+ print(e);
+ if (s != null) print(s);
+ }
+ for(;false;) {}
+ var list = ["Hello, World!"];
+ print(list[i]);
+ list[i] = "Hello, Brave New World!";
+ print(list[i]);
+ i = 87;
+ print(-i);
+ print(~i);
+ print(!(i == 42));
+ print(--i);
+ print(++i);
+ print(i--);
+ print(i++);
+ print(new Object());
+ print(const Object());
+ print((new List<String>(2)).runtimeType);
+ foo(fisk: "Blorp gulp");
+ f() {
+ print("f was called");
+ }
+ caller(f);
+ caller(() {
+ print("<anon> was called");
+ });
+ g([message]) {
+ print(message);
+ }
+ g("Hello, World");
+ caller(([x]) {
+ print("<anon> was called with $x");
+ });
+ h({message}) {
+ print(message);
+ }
+ h(message: "Hello, World");
+ caller(({x}) {
+ print("<anon> was called with $x");
+ });
+ print((int).toString());
+ print(int);
+ print(int..toString());
+ try {
+ print(int?.toString());
+ throw "Shouldn't work";
+ } on NoSuchMethodError catch (e) {
+ print("As expected: $e");
+ }
+ print(int.parse("42"));
+}
« no previous file with comments | « pkg/fasta/test/default_values.dart.outline.expect ('k') | pkg/fasta/test/expressions.dart.dartk.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698