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

Unified Diff: tests/compiler/dart2js/string_escapes_test.dart

Issue 326913002: Make dart2js unittests async. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 6 years, 6 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 | « tests/compiler/dart2js/strength_eq_test.dart ('k') | tests/compiler/dart2js/switch_empty_default_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/string_escapes_test.dart
diff --git a/tests/compiler/dart2js/string_escapes_test.dart b/tests/compiler/dart2js/string_escapes_test.dart
index d47f7f1001eb2f6f50e7f4058ec0e6ce547acb7a..f439689b8dbe6617d03b3225006130ce4ca089f2 100644
--- a/tests/compiler/dart2js/string_escapes_test.dart
+++ b/tests/compiler/dart2js/string_escapes_test.dart
@@ -2,23 +2,28 @@
// 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 "package:expect/expect.dart";
+import 'dart:async';
+import 'package:async_helper/async_helper.dart';
+import 'package:expect/expect.dart';
import 'compiler_helper.dart';
// Test that the compiler handles string literals containing line terminators.
-String compileExpression(String expression) {
+Future<String> compileExpression(String expression) {
var source = "foo() { return $expression; }";
return compile(source, entry: "foo");
}
main() {
- String generated = compileExpression("''' \n\r\u2028\u2029'''");
- Expect.isTrue(generated.contains(r"\n\r\u2028\u2029"));
-
- generated = compileExpression("r''' \n\r\u2028\u2029'''");
- Expect.isTrue(generated.contains(r"\n\r\u2028\u2029"));
-
- generated = compileExpression("'\u2028\u2029'");
- Expect.isTrue(generated.contains(r"\u2028\u2029"));
+ asyncTest(() => Future.wait([
+ compileExpression("''' \n\r\u2028\u2029'''").then((String generated) {
+ Expect.isTrue(generated.contains(r"\n\r\u2028\u2029"));
+ }),
+ compileExpression("r''' \n\r\u2028\u2029'''").then((String generated) {
+ Expect.isTrue(generated.contains(r"\n\r\u2028\u2029"));
+ }),
+ compileExpression("'\u2028\u2029'").then((String generated) {
+ Expect.isTrue(generated.contains(r"\u2028\u2029"));
+ }),
+ ]));
}
« no previous file with comments | « tests/compiler/dart2js/strength_eq_test.dart ('k') | tests/compiler/dart2js/switch_empty_default_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698