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

Side by Side Diff: tests/compiler/dart2js_extra/useful_error_message_1_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 // Test that closures have a useful string that identifies the function by name 5 // Test that closures have a useful string that identifies the function by name
6 // in error messages. 6 // in error messages.
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 @NoInline() 10 @NoInline()
(...skipping 15 matching lines...) Expand all
26 if (!isMinified) { 26 if (!isMinified) {
27 Expect.equals("Instance of 'CCCC'", instanceString); 27 Expect.equals("Instance of 'CCCC'", instanceString);
28 } 28 }
29 29
30 checkContains(String message, String tag) { 30 checkContains(String message, String tag) {
31 if (!message.contains(tag)) { 31 if (!message.contains(tag)) {
32 if (!isMinified) { 32 if (!isMinified) {
33 Expect.fail('"$message" should contain "$tag"'); 33 Expect.fail('"$message" should contain "$tag"');
34 } 34 }
35 // When minified we will accept quoted names up to 3 characters. 35 // When minified we will accept quoted names up to 3 characters.
36 Expect.isTrue( 36 Expect.isTrue(message.contains(new RegExp("'..?.?'")),
37 message.contains(new RegExp("'..?.?'")),
38 '"$message" should contain minified name'); 37 '"$message" should contain minified name');
39 } 38 }
40 } 39 }
41 40
42 // We use ArgumentError.value since it prints the value using 41 // We use ArgumentError.value since it prints the value using
43 // Error.safeToString. 42 // Error.safeToString.
44 var e1 = new ArgumentError.value(c); 43 var e1 = new ArgumentError.value(c);
45 var s1 = '$e1'; 44 var s1 = '$e1';
46 Expect.isTrue(s1.contains(instanceString), 45 Expect.isTrue(s1.contains(instanceString),
47 'Error message "$s1" should contain "$instanceString"'); 46 'Error message "$s1" should contain "$instanceString"');
(...skipping 26 matching lines...) Expand all
74 checkContains(s5, "main_closure"); 73 checkContains(s5, "main_closure");
75 checkContains('$anon', "main_closure"); 74 checkContains('$anon', "main_closure");
76 75
77 // Local named closure. 76 // Local named closure.
78 localFunction() => c; 77 localFunction() => c;
79 var e6 = new ArgumentError.value(localFunction); 78 var e6 = new ArgumentError.value(localFunction);
80 var s6 = '$e6'; 79 var s6 = '$e6';
81 checkContains(s6, "localFunction"); 80 checkContains(s6, "localFunction");
82 checkContains('$localFunction', "localFunction"); 81 checkContains('$localFunction', "localFunction");
83 } 82 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/type_error_message_test.dart ('k') | tests/compiler/dart2js_native/abstract_class_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698