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

Side by Side Diff: tests/compiler/dart2js_extra/string_interpolation_test.dart

Issue 10920066: issue 4817 fixed. Implemented raw strings with 'r' instead of '@' for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased. Marked raw_string_test as pass for dart2js-ff and dart2dart Created 8 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
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 // Test that String interpolation works in the code generated by the leg 5 // Test that String interpolation works in the code generated by the leg
6 // compiler. 6 // compiler.
7 7
8 8
9 int ifun() => 37; 9 int ifun() => 37;
10 double dfun() => 2.71828; 10 double dfun() => 2.71828;
11 bool bfun() => true; 11 bool bfun() => true;
12 String sfun() => "sfun"; 12 String sfun() => "sfun";
13 void nfun() => null; 13 void nfun() => null;
14 14
15 15
16 void testEscapes() { 16 void testEscapes() {
17 // Test that escaping the '$' prevents string interpolation. 17 // Test that escaping the '$' prevents string interpolation.
18 String x = "NOT HERE"; 18 String x = "NOT HERE";
19 Expect.equals(@'a${x}', 'a\${x}'); 19 Expect.equals(r'a${x}', 'a\${x}');
20 Expect.equals(@'a$x', 'a\$x'); 20 Expect.equals(r'a$x', 'a\$x');
21 Expect.equals(@'a${x}', '''a\${x}'''); 21 Expect.equals(r'a${x}', '''a\${x}''');
22 Expect.equals(@'a$x', '''a\$x'''); 22 Expect.equals(r'a$x', '''a\$x''');
23 Expect.equals(@'a${x}', "a\${x}"); 23 Expect.equals(r'a${x}', "a\${x}");
24 Expect.equals(@'a$x', "a\$x"); 24 Expect.equals(r'a$x', "a\$x");
25 Expect.equals(@'a${x}', """a\${x}"""); 25 Expect.equals(r'a${x}', """a\${x}""");
26 Expect.equals(@'a$x', """a\$x"""); 26 Expect.equals(r'a$x', """a\$x""");
27 } 27 }
28 28
29 29
30 void testMultiLine() { 30 void testMultiLine() {
31 var a = "string"; 31 var a = "string";
32 var b = 42; 32 var b = 42;
33 var c = 3.1415; 33 var c = 3.1415;
34 var d = false; 34 var d = false;
35 var n = null; 35 var n = null;
36 36
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Lotsa-nested. 117 // Lotsa-nested.
118 Expect.equals("42", "${'${"${'${"${'${"$b"}'}"}'}"}'}"); 118 Expect.equals("42", "${'${"${'${"${'${"$b"}'}"}'}"}'}");
119 } 119 }
120 120
121 121
122 void main() { 122 void main() {
123 testSimple(); 123 testSimple();
124 testMultiLine(); 124 testMultiLine();
125 testEscapes(); 125 testEscapes();
126 } 126 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/string_escape_test.dart ('k') | tests/compiler/dart2js_foreign/foreign_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698