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

Side by Side Diff: tests/language/adjacent_const_string_literals_test.dart

Issue 10981026: Convert raw strings to new syntax (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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 5
6 class Conster { 6 class Conster {
7 const Conster(this.value); 7 const Conster(this.value);
8 8
9 final value; 9 final value;
10 10
11 toString() { 11 toString() {
12 return value.toString(); 12 return value.toString();
13 } 13 }
14 } 14 }
15 15
16 main() { 16 main() {
17 testEmpty(); 17 testEmpty();
18 testInterpolation(); 18 testInterpolation();
19 testMultiline(); 19 testMultiline();
20 } 20 }
21 21
22 testEmpty() { 22 testEmpty() {
23 Expect.equals("", (const Conster("" "" "")).toString()); 23 Expect.equals("", (const Conster("" "" "")).toString());
24 Expect.equals("", (const Conster("" '' "")).toString()); 24 Expect.equals("", (const Conster("" '' "")).toString());
25 Expect.equals("", (const Conster("" "" @"")).toString()); 25 Expect.equals("", (const Conster("" "" r"")).toString());
26 26
27 Expect.equals("a", (const Conster("a" "")).toString()); 27 Expect.equals("a", (const Conster("a" "")).toString());
28 Expect.equals("a", (const Conster("a" '')).toString()); 28 Expect.equals("a", (const Conster("a" '')).toString());
29 Expect.equals("a", (const Conster("a" @'')).toString()); 29 Expect.equals("a", (const Conster("a" r'')).toString());
30 30
31 Expect.equals("b", (const Conster('b' "")).toString()); 31 Expect.equals("b", (const Conster('b' "")).toString());
32 Expect.equals("b", (const Conster('b' '')).toString()); 32 Expect.equals("b", (const Conster('b' '')).toString());
33 Expect.equals("b", (const Conster('b' @'')).toString()); 33 Expect.equals("b", (const Conster('b' r'')).toString());
34 34
35 Expect.equals("c", (const Conster(@'c' "")).toString()); 35 Expect.equals("c", (const Conster(r'c' "")).toString());
36 Expect.equals("c", (const Conster(@'c' '')).toString()); 36 Expect.equals("c", (const Conster(r'c' '')).toString());
37 Expect.equals("c", (const Conster(@'c' @'')).toString()); 37 Expect.equals("c", (const Conster(r'c' r'')).toString());
38 38
39 Expect.equals("a", (const Conster("" "a")).toString()); 39 Expect.equals("a", (const Conster("" "a")).toString());
40 Expect.equals("a", (const Conster("" 'a')).toString()); 40 Expect.equals("a", (const Conster("" 'a')).toString());
41 Expect.equals("a", (const Conster("" @'a')).toString()); 41 Expect.equals("a", (const Conster("" r'a')).toString());
42 42
43 Expect.equals("b", (const Conster('' "b")).toString()); 43 Expect.equals("b", (const Conster('' "b")).toString());
44 Expect.equals("b", (const Conster('' 'b')).toString()); 44 Expect.equals("b", (const Conster('' 'b')).toString());
45 Expect.equals("b", (const Conster('' @'b')).toString()); 45 Expect.equals("b", (const Conster('' r'b')).toString());
46 46
47 Expect.equals("c", (const Conster(@'' "c")).toString()); 47 Expect.equals("c", (const Conster(r'' "c")).toString());
48 Expect.equals("c", (const Conster(@'' 'c')).toString()); 48 Expect.equals("c", (const Conster(r'' 'c')).toString());
49 Expect.equals("c", (const Conster(@'' @'c')).toString()); 49 Expect.equals("c", (const Conster(r'' r'c')).toString());
50 } 50 }
51 51
52 const s = "a"; 52 const s = "a";
53 53
54 testInterpolation() { 54 testInterpolation() {
55 Expect.equals(@"ab", (const Conster("$s" "b")).toString()); 55 Expect.equals(r"ab", (const Conster("$s" "b")).toString());
56 Expect.equals(@"ab", (const Conster('$s' "b")).toString()); 56 Expect.equals(r"ab", (const Conster('$s' "b")).toString());
57 Expect.equals(@"$sb", (const Conster(@'$s' "b")).toString()); 57 Expect.equals(r"$sb", (const Conster(r'$s' "b")).toString());
58 58
59 Expect.equals(@"-a-b", (const Conster("-$s-" "b")).toString()); 59 Expect.equals(r"-a-b", (const Conster("-$s-" "b")).toString());
60 Expect.equals(@"-a-b", (const Conster('-$s-' "b")).toString()); 60 Expect.equals(r"-a-b", (const Conster('-$s-' "b")).toString());
61 Expect.equals(@"-$s-b", (const Conster(@'-$s-' "b")).toString()); 61 Expect.equals(r"-$s-b", (const Conster(r'-$s-' "b")).toString());
62 62
63 Expect.equals(@"ba", (const Conster('b' "$s")).toString()); 63 Expect.equals(r"ba", (const Conster('b' "$s")).toString());
64 Expect.equals(@"ba", (const Conster('b' '$s')).toString()); 64 Expect.equals(r"ba", (const Conster('b' '$s')).toString());
65 Expect.equals(@"b$s", (const Conster('b' @'$s')).toString()); 65 Expect.equals(r"b$s", (const Conster('b' r'$s')).toString());
66 66
67 Expect.equals(@"b-a-", (const Conster('b' "-$s-")).toString()); 67 Expect.equals(r"b-a-", (const Conster('b' "-$s-")).toString());
68 Expect.equals(@"b-a-", (const Conster('b' '-$s-')).toString()); 68 Expect.equals(r"b-a-", (const Conster('b' '-$s-')).toString());
69 Expect.equals(@"b-$s-", (const Conster('b' @'-$s-')).toString()); 69 Expect.equals(r"b-$s-", (const Conster('b' r'-$s-')).toString());
70 } 70 }
71 71
72 testMultiline() { 72 testMultiline() {
73 Expect.equals("abe", 73 Expect.equals("abe",
74 (const Conster("a" 74 (const Conster("a"
75 "b" 75 "b"
76 "e")).toString()); 76 "e")).toString());
77 Expect.equals("a b e", 77 Expect.equals("a b e",
78 (const Conster("a " 78 (const Conster("a "
79 "b " 79 "b "
80 "e")).toString()); 80 "e")).toString());
81 Expect.equals("a b e", 81 Expect.equals("a b e",
82 (const Conster("a" 82 (const Conster("a"
83 " b" 83 " b"
84 " e")).toString()); 84 " e")).toString());
85 85
86 Expect.equals("abe", (const Conster(""" 86 Expect.equals("abe", (const Conster("""
87 a""" "b" "e")).toString()); 87 a""" "b" "e")).toString());
88 Expect.equals("a b e", (const Conster(""" 88 Expect.equals("a b e", (const Conster("""
89 a""" " b" " e")).toString()); 89 a""" " b" " e")).toString());
90 90
91 Expect.equals("abe", (const Conster(""" 91 Expect.equals("abe", (const Conster("""
92 a""" """ 92 a""" """
93 b""" """ 93 b""" """
94 e""")).toString()); 94 e""")).toString());
95 } 95 }
96 96
OLDNEW
« no previous file with comments | « tests/corelib/string_split_reg_exp_test.dart ('k') | tests/language/adjacent_string_literals_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698