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

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

Issue 23533040: Check for non-final field in the face of const constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated cf. comments. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | 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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 library dart2js.test.message_kind_helper; 5 library dart2js.test.message_kind_helper;
6 6
7 import 'package:expect/expect.dart'; 7 import 'package:expect/expect.dart';
8 import 'dart:async'; 8 import 'dart:async';
9 9
10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show 10 import '../../../sdk/lib/_internal/compiler/implementation/dart2jslib.dart' show
(...skipping 26 matching lines...) Expand all
37 return compiler.run(Uri.parse('memory:main.dart')).then((_) { 37 return compiler.run(Uri.parse('memory:main.dart')).then((_) {
38 38
39 Expect.isFalse(messages.isEmpty, 'No messages in """$example"""'); 39 Expect.isFalse(messages.isEmpty, 'No messages in """$example"""');
40 40
41 String expectedText = !kind.hasHowToFix 41 String expectedText = !kind.hasHowToFix
42 ? kind.template : '${kind.template}\n${kind.howToFix}'; 42 ? kind.template : '${kind.template}\n${kind.howToFix}';
43 String pattern = expectedText.replaceAllMapped( 43 String pattern = expectedText.replaceAllMapped(
44 new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}'); 44 new RegExp(ESCAPE_REGEXP), (m) => '\\${m[0]}');
45 pattern = pattern.replaceAll(new RegExp(r'#\\\{[^}]*\\\}'), '.*'); 45 pattern = pattern.replaceAll(new RegExp(r'#\\\{[^}]*\\\}'), '.*');
46 46
47 // TODO(johnniwinther): Extend MessageKind to contain information on
48 // where info messages are expected.
49 bool messageFound = false;
47 for (String message in messages) { 50 for (String message in messages) {
48 Expect.isTrue(new RegExp('^$pattern\$').hasMatch(message), 51 if (new RegExp('^$pattern\$').hasMatch(message)) {
49 '"$pattern" does not match "$message"'); 52 messageFound = true;
53 }
50 } 54 }
55 Expect.isTrue(messageFound, '"$pattern" does not match any in $messages');
51 return compiler; 56 return compiler;
52 }); 57 });
53 } 58 }
54 59
55 return cachedCompiler; 60 return new Future<Compiler>.sync(cachedCompiler);
56 } 61 }
OLDNEW
« no previous file with comments | « tests/co19/co19-dart2js.status ('k') | tests/compiler/dart2js/mock_compiler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698