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

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

Issue 8318031: Interpolated strings are never considered compile time const (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 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 | Annotate | Revision Log
« no previous file with comments | « tests/language/src/StringInterpolation7NegativeTest.dart ('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 4
5 // Tests for string interpolation 5 // Tests for string interpolation
6 class StringInterpolationTest { 6 class StringInterpolationTest {
7 7
8 StringInterpolationTest() {} 8 StringInterpolationTest() {}
9 9
10 static final int i = 1; 10 static final int i = 1;
(...skipping 16 matching lines...) Expand all
27 var c4 = '4'; 27 var c4 = '4';
28 // no chars before/after/between embedded expressions 28 // no chars before/after/between embedded expressions
29 Expect.equals(" 1", " ${c1}"); 29 Expect.equals(" 1", " ${c1}");
30 Expect.equals("1 ", "${c1} "); 30 Expect.equals("1 ", "${c1} ");
31 Expect.equals("1", "${c1}"); 31 Expect.equals("1", "${c1}");
32 Expect.equals("12", "${c1}${c2}"); 32 Expect.equals("12", "${c1}${c2}");
33 Expect.equals("12 34", "${c1}${c2} ${c3}${c4}"); 33 Expect.equals("12 34", "${c1}${c2} ${c3}${c4}");
34 34
35 // embedding static fields 35 // embedding static fields
36 Expect.equals(" hi 1 ", " hi ${i} "); 36 Expect.equals(" hi 1 ", " hi ${i} ");
37 Expect.equals(true, " hi ${i} " === " hi ${i} ");
38 Expect.equals(" hi <hi> ", " hi ${a} "); 37 Expect.equals(" hi <hi> ", " hi ${a} ");
39 38
40 // embedding method parameters 39 // embedding method parameters
41 Expect.equals("param = 9", test.embedParams(9)); 40 Expect.equals("param = 9", test.embedParams(9));
42 41
43 // embedding a class field 42 // embedding a class field
44 Expect.equals("j = 3", test.embedSingleField()); 43 Expect.equals("j = 3", test.embedSingleField());
45 44
46 // embedding more than one (non-constant) expression 45 // embedding more than one (non-constant) expression
47 Expect.equals(" hi 1 <hi>", " hi ${i} ${a}"); 46 Expect.equals(" hi 1 <hi>", " hi ${i} ${a}");
(...skipping 21 matching lines...) Expand all
69 } 68 }
70 69
71 String embedMultipleFields() { 70 String embedMultipleFields() {
72 return "j = ${j}; k = ${k}"; 71 return "j = ${j}; k = ${k}";
73 } 72 }
74 } 73 }
75 74
76 main() { 75 main() {
77 StringInterpolationTest.testMain(false); 76 StringInterpolationTest.testMain(false);
78 } 77 }
OLDNEW
« no previous file with comments | « tests/language/src/StringInterpolation7NegativeTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698