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

Side by Side Diff: tests/compiler/dart2js/js_spec_optimization_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'package:async_helper/async_helper.dart'; 6 import 'package:async_helper/async_helper.dart';
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'compiler_helper.dart'; 8 import 'compiler_helper.dart';
9 9
10 const String TEST_1 = r""" 10 const String TEST_1 = r"""
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 '#.toLowerCase()', s); 50 '#.toLowerCase()', s);
51 var s2 = JS('returns:String;depends:none;effects:none;throws:null(1)', 51 var s2 = JS('returns:String;depends:none;effects:none;throws:null(1)',
52 '#.toUpperCase()', s); 52 '#.toUpperCase()', s);
53 print(s2); 53 print(s2);
54 54
55 // absent: 'toLowerCase' - removed since s.toUpperCase() generates the same 55 // absent: 'toLowerCase' - removed since s.toUpperCase() generates the same
56 // noSuchMethod. 56 // noSuchMethod.
57 } 57 }
58 """; 58 """;
59 59
60
61 main() { 60 main() {
62 RegExp directivePattern = new RegExp( 61 RegExp directivePattern = new RegExp(
63 // \1 \2 \3 62 // \1 \2 \3
64 r'''// *(present|absent): (?:"([^"]*)"|'([^'']*)')''', 63 r'''// *(present|absent): (?:"([^"]*)"|'([^'']*)')''',
65 multiLine: true); 64 multiLine: true);
66 65
67 Future check(String test) { 66 Future check(String test) {
68 Uri uri = new Uri(scheme: 'dart', path: 'test'); 67 Uri uri = new Uri(scheme: 'dart', path: 'test');
69 var compiler = compilerFor(test, uri, expectedErrors: 0); 68 var compiler = compilerFor(test, uri, expectedErrors: 0);
70 return compiler.run(uri).then((_) { 69 return compiler.run(uri).then((_) {
(...skipping 10 matching lines...) Expand all
81 } else { 80 } else {
82 assert(directive == 'absent'); 81 assert(directive == 'absent');
83 Expect.isFalse(generated.contains(pattern), 82 Expect.isFalse(generated.contains(pattern),
84 "Must not find '$pattern' in:\n$generated"); 83 "Must not find '$pattern' in:\n$generated");
85 } 84 }
86 } 85 }
87 }); 86 });
88 } 87 }
89 88
90 asyncTest(() => Future.wait([ 89 asyncTest(() => Future.wait([
91 check(TEST_1), 90 check(TEST_1),
92 check(TEST_2), 91 check(TEST_2),
93 check(TEST_3), 92 check(TEST_3),
94 ])); 93 ]));
95 } 94 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/js_safety_test.dart ('k') | tests/compiler/dart2js/js_spec_string_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698