OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, 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 import 'package:expect/expect.dart'; |
| 6 import 'multiline_newline_cr.dart' as cr; |
| 7 import 'multiline_newline_crlf.dart' as crlf; |
| 8 import 'multiline_newline_lf.dart' as lf; |
| 9 |
| 10 main() { |
| 11 Expect.equals(4, cr.constantMultilineString.length); |
| 12 Expect.equals(4, crlf.constantMultilineString.length); |
| 13 Expect.equals(4, lf.constantMultilineString.length); |
| 14 Expect.equals(cr.constantMultilineString, crlf.constantMultilineString); |
| 15 Expect.equals(crlf.constantMultilineString, lf.constantMultilineString); |
| 16 Expect.equals(lf.constantMultilineString, cr.constantMultilineString); |
| 17 |
| 18 Expect.equals(4, cr.nonConstantMultilineString.length); |
| 19 Expect.equals(4, crlf.nonConstantMultilineString.length); |
| 20 Expect.equals(4, lf.nonConstantMultilineString.length); |
| 21 Expect.equals(cr.nonConstantMultilineString, crlf.nonConstantMultilineString); |
| 22 Expect.equals(crlf.nonConstantMultilineString, lf.nonConstantMultilineString); |
| 23 Expect.equals(lf.nonConstantMultilineString, cr.nonConstantMultilineString); |
| 24 |
| 25 const c1 = |
| 26 cr.constantMultilineString == crlf.constantMultilineString ? true : null; |
| 27 const c2 = |
| 28 crlf.constantMultilineString == lf.constantMultilineString ? true : null; |
| 29 const c3 = |
| 30 lf.constantMultilineString == cr.constantMultilineString ? true : null; |
| 31 Expect.isTrue(c1); |
| 32 Expect.isTrue(c2); |
| 33 Expect.isTrue(c3); |
| 34 |
| 35 const c4 = c1 ? 1 : 2; /// 01: ok |
| 36 Expect.equals(1, c4); /// 01: continued |
| 37 |
| 38 const c5 = c2 ? 2 : 3; /// 02: ok |
| 39 Expect.equals(2, c5); /// 02: continued |
| 40 |
| 41 const c6 = c3 ? 3 : 4; /// 03: ok |
| 42 Expect.equals(3, c6); /// 03: continued |
| 43 |
| 44 const c7 = |
| 45 cr.constantMultilineString != crlf.constantMultilineString ? true : null; |
| 46 const c8 = |
| 47 crlf.constantMultilineString != lf.constantMultilineString ? true : null; |
| 48 const c9 = |
| 49 lf.constantMultilineString != cr.constantMultilineString ? true : null; |
| 50 Expect.isNull(c7); |
| 51 Expect.isNull(c8); |
| 52 Expect.isNull(c9); |
| 53 |
| 54 const c10 = c7 ? 1 : 2; /// 04: compile-time error |
| 55 const c11 = c8 ? 2 : 3; /// 05: compile-time error |
| 56 const c12 = c9 ? 3 : 4; /// 06: compile-time error |
| 57 } |
OLD | NEW |