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

Side by Side Diff: tests/language/src/AdjacentConstStringLiteralsTest.dart

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

Powered by Google App Engine
This is Rietveld 408576698