| Index: frog/tests/leg_only/src/LiteralStringJuxtapositionTest.dart
|
| diff --git a/frog/tests/leg_only/src/LiteralStringJuxtapositionTest.dart b/frog/tests/leg_only/src/LiteralStringJuxtapositionTest.dart
|
| index f2e914728f5fa4ec67751da14c730169b504f761..c804e135a07766d8c5085e25abce1a10b4743fe9 100644
|
| --- a/frog/tests/leg_only/src/LiteralStringJuxtapositionTest.dart
|
| +++ b/frog/tests/leg_only/src/LiteralStringJuxtapositionTest.dart
|
| @@ -54,4 +54,54 @@ main() {
|
|
|
| // Binds stronger than property access (it's considered one literal).
|
| Expect.equals(5, "ab" "cde".length, "Associativity");
|
| +
|
| + // Check that interpolations are handled correctly.
|
| + {
|
| + var x = "foo";
|
| + var y = 42;
|
| + var z = true;
|
| + String e1 = "$x$y$z";
|
| + Expect.equals(e1, "$x" "$y$z");
|
| + Expect.equals(e1, "$x$y" "$z");
|
| + Expect.equals(e1, "$x" "$y" "$z");
|
| + String e2 = "-$x-$y-$z-";
|
| + Expect.equals(e2, "-" "$x" "-" "$y" "-" "$z" "-", "a");
|
| + Expect.equals(e2, "-$x" "-" "$y" "-" "$z" "-", "b");
|
| + Expect.equals(e2, "-" "$x-" "$y" "-" "$z" "-", "c");
|
| + Expect.equals(e2, "-" "$x" "-$y" "-" "$z" "-", "d");
|
| + Expect.equals(e2, "-" "$x" "-" "$y-" "$z" "-", "e");
|
| + Expect.equals(e2, "-" "$x" "-" "$y" "-$z" "-", "f");
|
| + Expect.equals(e2, "-" "$x" "-" "$y" "-" "$z-", "g");
|
| + Expect.equals(e2, "-" "$x-$y" "-" "$z" "-", "h");
|
| + Expect.equals(e2, "-" "$x-$y-$z" "-", "i");
|
| +
|
| + Expect.equals("-$x-$y-", "-" "$x" "-" "$y" "-");
|
| + Expect.equals("-$x-$y", "-" "$x" "-" "$y");
|
| + Expect.equals("-$x$y-", "-" "$x" "$y" "-");
|
| + Expect.equals("$x-$y-", "$x" "-" "$y" "-");
|
| +
|
| + Expect.equals("$x$y", "$x" "$y");
|
| + Expect.equals("$x$y", "$x" "" "$y");
|
| + Expect.equals("$x$y", "$x" "" "" "$y");
|
| + Expect.equals("$x-$y", "$x" "-" "$y");
|
| + Expect.equals("$x-$y", "$x" "-" "" "$y");
|
| + Expect.equals("$x-$y", "$x" "" "-" "$y");
|
| + Expect.equals("$x-$y", "$x" "" "-" "" "$y");
|
| + Expect.equals("$x--$y", "$x" "-" "-" "$y");
|
| + Expect.equals("$x--$y", "$x" "-" "-" "$y");
|
| + Expect.equals("$x--$y", "$x" "-" "-" "" "$y");
|
| + Expect.equals("$x--$y", "$x" "-" "" "-" "$y");
|
| + Expect.equals("$x--$y", "$x" "" "-" "-" "$y");
|
| +
|
| + Expect.equals("$x-$y-$z", "${'$x' '-' '$y'}" "-" "$z");
|
| +
|
| + Expect.equals(@"-foo-42-true-",
|
| + @"-" "$x" @"""-""" """$y""" @'-' '$z' @'''-''', "j");
|
| + Expect.equals(@"-$x-42-true-",
|
| + @"-" @"$x" @"""-""" """$y""" @'-' '$z' @'''-''', "j");
|
| + Expect.equals(@"-foo-$y-true-",
|
| + @"-" "$x" @"""-""" @"""$y""" @'-' '$z' @'''-''', "j");
|
| + Expect.equals(@"-foo-42-$z-",
|
| + @"-" "$x" @"""-""" """$y""" @'-' @'$z' @'''-''', "j");
|
| + }
|
| }
|
|
|