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

Side by Side Diff: tests/language/src/StringInterpolateTest.dart

Issue 8585044: Fixes issues in string interpolation tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove debugging code Created 9 years, 1 month 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
« frog/value.dart ('K') | « tests/language/language.status ('k') | 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 // Dart test program testing string interpolation. 4 // Dart test program testing string interpolation.
5 5
6 6
7 class WhatchamaCallIt { 7 class WhatchamaCallIt {
8 WhatchamaCallIt() { } 8 WhatchamaCallIt() { }
9 9
10 void foo() { 10 String foo() {
11 return "Hansel and $name"; // Field name is defined in subclass. 11 // Test $this and Field name is defined in subclass.
12 return "$this and $name";
12 } 13 }
13 } 14 }
14 15
15 class ThingamaBob extends WhatchamaCallIt { 16 class ThingamaBob extends WhatchamaCallIt {
16 ThingamaBob(String s) : super(), name = s { } 17 ThingamaBob(String s) : super(), name = s { }
17 String name; 18 String name;
19 toString() => "Hansel";
18 } 20 }
19 21
20 class StringInterpolateTest { 22 class StringInterpolateTest {
21 23
22 static final String A = "svin"; 24 static final String A = "svin";
23 static final String B = "hest"; 25 static final String B = "hest";
24 static final int N = 1 + 1; 26 static final int N = 1 + 1;
25 static String Printers; 27 static String Printers;
26 static String AAR_Printers; 28 static String AAR_Printers;
27 29
28 static testMain() { 30 static testMain() {
29 Printers = "Printers: $A and $B"; 31 Printers = "Printers: $A and $B";
30 AAR_Printers = "AAR has $N $Printers."; 32 AAR_Printers = "AAR has $N $Printers.";
31 33
32 var x = 1; 34 var x = 1;
33 var s = "eins und \$x macht zwei."; 35 var s = "eins und \$x macht zwei.";
34 print(s); 36 print(s);
35 Expect.equals(@"eins und $x macht zwei.", s); 37 Expect.equals(@"eins und $x macht zwei.", s);
36 38
37 s = "eins und $x macht zwei."; 39 s = "eins und $x macht zwei.";
38 print(s); 40 print(s);
39 Expect.equals(@"eins und 1 macht zwei.", s); 41 Expect.equals(@"eins und 1 macht zwei.", s);
40 42
41 print(AAR_Printers); 43 print(AAR_Printers);
(...skipping 10 matching lines...) Expand all
52 54
53 var t = new ThingamaBob("Gretel"); 55 var t = new ThingamaBob("Gretel");
54 print(t.foo()); 56 print(t.foo());
55 Expect.equals(t.foo(), "Hansel and Gretel"); 57 Expect.equals(t.foo(), "Hansel and Gretel");
56 } 58 }
57 } 59 }
58 60
59 main() { 61 main() {
60 StringInterpolateTest.testMain(); 62 StringInterpolateTest.testMain();
61 } 63 }
OLDNEW
« frog/value.dart ('K') | « tests/language/language.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698