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

Side by Side Diff: tests/compiler/dart2js_extra/mirrors_used_warning_test.dart

Issue 2352343002: Undo dartfmt in multitest. (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 @MirrorsUsed(symbols: 'foo') 5 @MirrorsUsed(symbols: 'foo')
6 import 'dart:mirrors'; 6 import 'dart:mirrors';
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 10
11 class A { 11 class A {
12 noSuchMethod(Invocation invocation) { 12 noSuchMethod(Invocation invocation) {
13 return MirrorSystem.getName(invocation.memberName); 13 return MirrorSystem.getName(invocation.memberName);
14 } 14 }
15 } 15 }
16 16
17 var lines = []; 17 var lines = [];
18 capturePrint(Zone self, ZoneDelegate parent, Zone origin, line) { 18 capturePrint(Zone self, ZoneDelegate parent, Zone origin, line) {
19 lines.add(line); 19 lines.add(line);
20 } 20 }
21 21
22 runTests() { 22 runTests() {
23 // "foo" is in MirrorsUsed and should therefore always work. 23 // "foo" is in MirrorsUsed and should therefore always work.
24 Expect.equals("foo", new A().foo); 24 Expect.equals("foo", new A().foo);
25 Expect.isTrue(lines.isEmpty); 25 Expect.isTrue(lines.isEmpty);
26 var barResult = new A().bar; 26 var barResult = new A().bar;
27 Expect.equals("bar", barResult); 27 Expect.equals("bar", barResult); /// minif: ok
28 28
29 /// minif: ok
30 Expect.isTrue(lines.length == 1); 29 Expect.isTrue(lines.length == 1);
31 var line = lines.first; 30 var line = lines.first;
32 Expect.isTrue(line.contains("Warning") && 31 Expect.isTrue(line.contains("Warning") &&
33 line.contains("bar") && 32 line.contains("bar") && /// minif: continued
34
35 /// minif: continued
36 line.contains("minif")); 33 line.contains("minif"));
37 } 34 }
38 35
39 main() { 36 main() {
40 runZoned(runTests, 37 runZoned(runTests,
41 zoneSpecification: new ZoneSpecification(print: capturePrint)); 38 zoneSpecification: new ZoneSpecification(print: capturePrint));
42 } 39 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698