| Index: tests/compiler/dart2js_extra/string_interpolation_test.dart
|
| diff --git a/tests/compiler/dart2js_extra/string_interpolation_test.dart b/tests/compiler/dart2js_extra/string_interpolation_test.dart
|
| index b8350e10cd08baf11da11aa97658169714b41c06..3407260bb33ca8d2fbb8c625132d33804696a9e8 100644
|
| --- a/tests/compiler/dart2js_extra/string_interpolation_test.dart
|
| +++ b/tests/compiler/dart2js_extra/string_interpolation_test.dart
|
| @@ -9,14 +9,12 @@ import "package:expect/expect.dart";
|
| // Test that String interpolation works in the code generated by the leg
|
| // compiler.
|
|
|
| -
|
| int ifun() => 37;
|
| double dfun() => 2.71828;
|
| bool bfun() => true;
|
| String sfun() => "sfun";
|
| void nfun() => null;
|
|
|
| -
|
| void testEscapes() {
|
| // Test that escaping the '$' prevents string interpolation.
|
| String x = "NOT HERE";
|
| @@ -30,7 +28,6 @@ void testEscapes() {
|
| Expect.equals(r'a$x', """a\$x""");
|
| }
|
|
|
| -
|
| void testMultiLine() {
|
| var a = "string";
|
| var b = 42;
|
| @@ -55,17 +52,20 @@ void testMultiLine() {
|
|
|
| // Newlines at beginning of multiline strings are not included, but only
|
| // if they are in the source.
|
| - Expect.equals("\n", """${''}
|
| + Expect.equals(
|
| + "\n",
|
| + """${''}
|
| """);
|
| Expect.equals("\r", """${''}
|
| """);
|
| - Expect.equals("\r\n", """${''}
|
| + Expect.equals(
|
| + "\r\n",
|
| + """${''}
|
| """);
|
| Expect.equals("\n", """${'\n'}""");
|
| Expect.equals("\r", """${'\r'}""");
|
| Expect.equals("\r\n", """${'\r\n'}""");
|
| }
|
|
|
| -
|
| void testSimple() {
|
| var a = "string";
|
| var b = 42;
|
| @@ -87,17 +87,16 @@ void testSimple() {
|
| Expect.equals("423.1415falsenull!string", "$b$c$d$n!$a");
|
|
|
| // Function calls as expressions.
|
| - Expect.equals("sfun372.71828truenull",
|
| - "${sfun()}${ifun()}${dfun()}${bfun()}${nfun()}");
|
| - Expect.equals("nullsfun372.71828true",
|
| - "${nfun()}${sfun()}${ifun()}${dfun()}${bfun()}");
|
| - Expect.equals("truenullsfun372.71828",
|
| - "${bfun()}${nfun()}${sfun()}${ifun()}${dfun()}");
|
| - Expect.equals("2.71828truenullsfun37",
|
| - "${dfun()}${bfun()}${nfun()}${sfun()}${ifun()}");
|
| - Expect.equals("372.71828truenullsfun",
|
| - "${ifun()}${dfun()}${bfun()}${nfun()}${sfun()}");
|
| -
|
| + Expect.equals(
|
| + "sfun372.71828truenull", "${sfun()}${ifun()}${dfun()}${bfun()}${nfun()}");
|
| + Expect.equals(
|
| + "nullsfun372.71828true", "${nfun()}${sfun()}${ifun()}${dfun()}${bfun()}");
|
| + Expect.equals(
|
| + "truenullsfun372.71828", "${bfun()}${nfun()}${sfun()}${ifun()}${dfun()}");
|
| + Expect.equals(
|
| + "2.71828truenullsfun37", "${dfun()}${bfun()}${nfun()}${sfun()}${ifun()}");
|
| + Expect.equals(
|
| + "372.71828truenullsfun", "${ifun()}${dfun()}${bfun()}${nfun()}${sfun()}");
|
|
|
| // String contents around interpolated parts.
|
| Expect.equals("stringstring", "$a$a");
|
| @@ -121,7 +120,6 @@ void testSimple() {
|
| Expect.equals("42", "${'${"${'${"${'${"$b"}'}"}'}"}'}");
|
| }
|
|
|
| -
|
| void main() {
|
| testSimple();
|
| testMultiLine();
|
|
|