Chromium Code Reviews| Index: tests/language/multiline_newline_test.dart |
| diff --git a/tests/language/multiline_newline_test.dart b/tests/language/multiline_newline_test.dart |
| index c048632edcf58948d16133a44940525018c462b9..4ab7356d6184946c858fca5c1d3197c4a11db918 100644 |
| --- a/tests/language/multiline_newline_test.dart |
| +++ b/tests/language/multiline_newline_test.dart |
| @@ -11,17 +11,38 @@ main() { |
| Expect.equals(4, cr.constantMultilineString.length); |
| Expect.equals(4, crlf.constantMultilineString.length); |
| Expect.equals(4, lf.constantMultilineString.length); |
| + |
| + Expect.equals(6, cr.constantRawMultilineString.length); |
| + Expect.equals(6, crlf.constantRawMultilineString.length); |
| + Expect.equals(6, lf.constantRawMultilineString.length); |
| + |
| Expect.equals(cr.constantMultilineString, crlf.constantMultilineString); |
| Expect.equals(crlf.constantMultilineString, lf.constantMultilineString); |
| Expect.equals(lf.constantMultilineString, cr.constantMultilineString); |
| + Expect.equals(cr.constantRawMultilineString, crlf.constantRawMultilineString); |
| + Expect.equals(crlf.constantRawMultilineString, lf.constantRawMultilineString); |
| + Expect.equals(lf.constantRawMultilineString, cr.constantRawMultilineString); |
| + |
| Expect.equals(4, cr.nonConstantMultilineString.length); |
| Expect.equals(4, crlf.nonConstantMultilineString.length); |
| Expect.equals(4, lf.nonConstantMultilineString.length); |
| + |
| + Expect.equals(6, cr.nonConstantRawMultilineString.length); |
| + Expect.equals(6, crlf.nonConstantRawMultilineString.length); |
| + Expect.equals(6, lf.nonConstantRawMultilineString.length); |
| + |
| Expect.equals(cr.nonConstantMultilineString, crlf.nonConstantMultilineString); |
| Expect.equals(crlf.nonConstantMultilineString, lf.nonConstantMultilineString); |
| Expect.equals(lf.nonConstantMultilineString, cr.nonConstantMultilineString); |
| + Expect.equals( |
| + cr.nonConstantRawMultilineString, crlf.nonConstantRawMultilineString); |
| + Expect.equals( |
| + crlf.nonConstantRawMultilineString, lf.nonConstantRawMultilineString); |
| + Expect.equals( |
| + lf.nonConstantRawMultilineString, cr.nonConstantRawMultilineString); |
| + |
| const c1 = |
| cr.constantMultilineString == crlf.constantMultilineString ? true : null; |
| const c2 = |
| @@ -32,6 +53,19 @@ main() { |
| Expect.isTrue(c2); |
| Expect.isTrue(c3); |
| + const c1r = cr.constantRawMultilineString == crlf.constantRawMultilineString |
| + ? true |
| + : null; |
|
Lasse Reichstein Nielsen
2017/04/28 06:34:28
Why the `? true : null` followed by `Expect.isTrue
Johnni Winther
2017/04/28 07:12:00
For analyzer testing. See lines 110-116
|
| + const c2r = crlf.constantRawMultilineString == lf.constantRawMultilineString |
| + ? true |
| + : null; |
| + const c3r = lf.constantRawMultilineString == cr.constantRawMultilineString |
| + ? true |
| + : null; |
| + Expect.isTrue(c1r); |
| + Expect.isTrue(c2r); |
| + Expect.isTrue(c3r); |
| + |
| const c4 = c1 ? 1 : 2; // //# 01: ok |
| Expect.equals(1, c4); // //# 01: continued |
| @@ -41,6 +75,15 @@ main() { |
| const c6 = c3 ? 3 : 4; // //# 03: ok |
| Expect.equals(3, c6); // //# 03: continued |
| + const c4r = c1r ? 1 : 2; // //# 01r: ok |
| + Expect.equals(1, c4r); // //# 01r: continued |
|
Lasse Reichstein Nielsen
2017/04/28 06:34:28
Comment indentation off by one :)
More below.
ahe
2017/04/28 07:39:00
Acknowledged.
ahe
2017/05/08 08:36:17
Done.
|
| + |
| + const c5r = c2r ? 2 : 3; // //# 02r: ok |
| + Expect.equals(2, c5r); // //# 02r: continued |
| + |
| + const c6r = c3r ? 3 : 4; // //# 03r: ok |
| + Expect.equals(3, c6r); // //# 03r: continued |
| + |
| const c7 = |
| cr.constantMultilineString != crlf.constantMultilineString ? true : null; |
| const c8 = |
| @@ -51,7 +94,24 @@ main() { |
| Expect.isNull(c8); |
| Expect.isNull(c9); |
| + const c7r = cr.constantRawMultilineString != crlf.constantRawMultilineString |
| + ? true |
| + : null; |
| + const c8r = crlf.constantRawMultilineString != lf.constantRawMultilineString |
| + ? true |
| + : null; |
| + const c9r = lf.constantRawMultilineString != cr.constantRawMultilineString |
| + ? true |
| + : null; |
| + Expect.isNull(c7r); |
| + Expect.isNull(c8r); |
| + Expect.isNull(c9r); |
| + |
| const c10 = c7 ? 1 : 2; // //# 04: compile-time error |
|
Lasse Reichstein Nielsen
2017/04/28 06:34:28
What is this testing? That `null` cannot be used a
Johnni Winther
2017/04/28 07:12:01
This is to validate the analyzer implementation. I
ahe
2017/04/28 07:39:00
Not only does this validate the analyzer implement
Lasse Reichstein Nielsen
2017/04/28 08:57:36
So the null is there to force a compile-time error
Johnni Winther
2017/04/28 09:19:43
We should probably add a comment about the intent
ahe
2017/05/08 08:36:17
Done.
|
| const c11 = c8 ? 2 : 3; // //# 05: compile-time error |
| const c12 = c9 ? 3 : 4; // //# 06: compile-time error |
| + |
| + const c10r = c7r ? 1 : 2; // //# 04r: compile-time error |
| + const c11r = c8r ? 2 : 3; // //# 05r: compile-time error |
| + const c12r = c9r ? 3 : 4; // //# 06r: compile-time error |
| } |