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

Side by Side Diff: tests/language/string_interpolation_and_buffer_test.dart

Issue 1289713002: Enable analyzer tests after fixing them for analysis (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « tests/language/language_analyzer2.status ('k') | tests/language/string_split_test.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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 to ensure that StringBuffer and string interpolation behaves 5 // Test to ensure that StringBuffer and string interpolation behaves
6 // the same and fail fast. 6 // the same and fail fast.
7 7
8 import "package:expect/expect.dart"; 8 import "package:expect/expect.dart";
9 9
10 class ToStringWrapper { 10 class ToStringWrapper {
11 final value; 11 final value;
12 12
13 ToStringWrapper(this.value); 13 ToStringWrapper(this.value);
14 14
15 toString() => value; 15 toString() => value;
16 } 16 }
17 17
18 wrap(value) => new ToStringWrapper(value); 18 wrap(value) => new ToStringWrapper(value);
19 19
20 final bool checkedMode = computeCheckedMode(); 20 final bool checkedMode = computeCheckedMode();
21 bool computeCheckedMode() { 21 bool computeCheckedMode() {
22 try { 22 try {
23 int x = "foo"; 23 var i = 42;
24 } on Error { 24 String s = i;
25 } on TypeError catch (e) {
25 return true; 26 return true;
26 } 27 }
27 return false; 28 return false;
28 } 29 }
29 30
30 main() { 31 main() {
31 interpolate(object) { 32 interpolate(object) {
32 var result; 33 var result;
33 if (checkedMode && object != null) { 34 if (checkedMode && object != null) {
34 try { 35 try {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 Expect.equals('Error', buffer([1])); 106 Expect.equals('Error', buffer([1]));
106 Expect.equals('Error', buffer(new Object())); 107 Expect.equals('Error', buffer(new Object()));
107 108
108 Expect.equals('Error', initBuffer(null)); 109 Expect.equals('Error', initBuffer(null));
109 Expect.equals('Success', initBuffer("")); 110 Expect.equals('Success', initBuffer(""));
110 Expect.equals('Success', initBuffer("string")); 111 Expect.equals('Success', initBuffer("string"));
111 Expect.equals('Error', initBuffer([])); 112 Expect.equals('Error', initBuffer([]));
112 Expect.equals('Error', initBuffer([1])); 113 Expect.equals('Error', initBuffer([1]));
113 Expect.equals('Error', initBuffer(new Object())); 114 Expect.equals('Error', initBuffer(new Object()));
114 } 115 }
OLDNEW
« no previous file with comments | « tests/language/language_analyzer2.status ('k') | tests/language/string_split_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698