OLD | NEW |
| (Empty) |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 main() { | |
6 testEmpty(); | |
7 testInterpolation(); | |
8 testMultiline(); | |
9 } | |
10 | |
11 testEmpty() { | |
12 Expect.equals("", "" "" ""); | |
13 Expect.equals("", "" '' ""); | |
14 Expect.equals("", "" "" @""); | |
15 | |
16 Expect.equals("a", "a" ""); | |
17 Expect.equals("a", "a" ''); | |
18 Expect.equals("a", "a" @''); | |
19 | |
20 Expect.equals("b", 'b' ""); | |
21 Expect.equals("b", 'b' ''); | |
22 Expect.equals("b", 'b' @''); | |
23 | |
24 Expect.equals("c", @'c' ""); | |
25 Expect.equals("c", @'c' ''); | |
26 Expect.equals("c", @'c' @''); | |
27 | |
28 Expect.equals("a", "" "a"); | |
29 Expect.equals("a", "" 'a'); | |
30 Expect.equals("a", "" @'a'); | |
31 | |
32 Expect.equals("b", '' "b"); | |
33 Expect.equals("b", '' 'b'); | |
34 Expect.equals("b", '' @'b'); | |
35 | |
36 Expect.equals("c", @'' "c"); | |
37 Expect.equals("c", @'' 'c'); | |
38 Expect.equals("c", @'' @'c'); | |
39 } | |
40 | |
41 testInterpolation() { | |
42 var s = "a"; | |
43 Expect.equals(@"ab", "$s" "b"); | |
44 Expect.equals(@"ab", '$s' "b"); | |
45 Expect.equals(@"$sb", @'$s' "b"); | |
46 | |
47 Expect.equals(@"-a-b", "-$s-" "b"); | |
48 Expect.equals(@"-a-b", '-$s-' "b"); | |
49 Expect.equals(@"-$s-b", @'-$s-' "b"); | |
50 | |
51 Expect.equals(@"ba", 'b' "$s"); | |
52 Expect.equals(@"ba", 'b' '$s'); | |
53 Expect.equals(@"b$s", 'b' @'$s'); | |
54 | |
55 Expect.equals(@"b-a-", 'b' "-$s-"); | |
56 Expect.equals(@"b-a-", 'b' '-$s-'); | |
57 Expect.equals(@"b-$s-", 'b' @'-$s-'); | |
58 } | |
59 | |
60 testMultiline() { | |
61 Expect.equals("abe", | |
62 "a" | |
63 "b" | |
64 "e"); | |
65 Expect.equals("a b e", | |
66 "a " | |
67 "b " | |
68 "e"); | |
69 Expect.equals("a b e", | |
70 "a" | |
71 " b" | |
72 " e"); | |
73 | |
74 Expect.equals("abe", """ | |
75 a""" "b" "e"); | |
76 Expect.equals("a b e", """ | |
77 a""" " b" " e"); | |
78 | |
79 Expect.equals("abe", """ | |
80 a""" """ | |
81 b""" """ | |
82 e"""); | |
83 } | |
84 | |
OLD | NEW |