| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 // Note: This test relies on LF line endings in the source file. | 5 // Note: This test relies on LF line endings in the source file. |
| 6 | 6 |
| 7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
| 8 | 8 |
| 9 class RawStringTest { | 9 class RawStringTest { |
| 10 static testMain() { | 10 static testMain() { |
| 11 Expect.equals("abcd", r"abcd"); | 11 Expect.equals("abcd", r"abcd"); |
| 12 Expect.equals("", r""); | 12 Expect.equals("", r""); |
| 13 Expect.equals("", r''); | 13 Expect.equals("", r''); |
| 14 Expect.equals("", r""""""); | 14 Expect.equals("", r""""""); |
| 15 Expect.equals("", r''''''); | 15 Expect.equals("", r''''''); |
| 16 Expect.equals("''''", r"''''"); | 16 Expect.equals("''''", r"''''"); |
| 17 Expect.equals('""""', r'""""'); | 17 Expect.equals('""""', r'""""'); |
| 18 Expect.equals("1\n2\n3", r"""1 | 18 Expect.equals( |
| 19 "1\n2\n3", |
| 20 r"""1 |
| 19 2 | 21 2 |
| 20 3"""); | 22 3"""); |
| 21 Expect.equals("1\n2\n3", r'''1 | 23 Expect.equals( |
| 24 "1\n2\n3", |
| 25 r'''1 |
| 22 2 | 26 2 |
| 23 3'''); | 27 3'''); |
| 24 Expect.equals("1", r""" | 28 Expect.equals( |
| 29 "1", |
| 30 r""" |
| 25 1"""); | 31 1"""); |
| 26 Expect.equals("1", r''' | 32 Expect.equals( |
| 33 "1", |
| 34 r''' |
| 27 1'''); | 35 1'''); |
| 28 Expect.equals("'", r"'"); | 36 Expect.equals("'", r"'"); |
| 29 Expect.equals('"', r'"'); | 37 Expect.equals('"', r'"'); |
| 30 Expect.equals("1", r"1"); | 38 Expect.equals("1", r"1"); |
| 31 Expect.equals("1", r"1"); | 39 Expect.equals("1", r"1"); |
| 32 Expect.equals("\$", r"$"); | 40 Expect.equals("\$", r"$"); |
| 33 Expect.equals("\\", r"\"); | 41 Expect.equals("\\", r"\"); |
| 34 Expect.equals("\\", r'\'); | 42 Expect.equals("\\", r'\'); |
| 35 Expect.equals("\${12}", r"${12}"); | 43 Expect.equals("\${12}", r"${12}"); |
| 36 Expect.equals("\\a\\b\\c\\d\\e\\f\\g\\h\\i\\j\\k\\l\\m", | 44 Expect.equals("\\a\\b\\c\\d\\e\\f\\g\\h\\i\\j\\k\\l\\m", |
| 37 r"\a\b\c\d\e\f\g\h\i\j\k\l\m"); | 45 r"\a\b\c\d\e\f\g\h\i\j\k\l\m"); |
| 38 Expect.equals("\\n\\o\\p\\q\\r\\s\\t\\u\\v\\w\\x\\y\\z", | 46 Expect.equals("\\n\\o\\p\\q\\r\\s\\t\\u\\v\\w\\x\\y\\z", |
| 39 r"\n\o\p\q\r\s\t\u\v\w\x\y\z"); | 47 r"\n\o\p\q\r\s\t\u\v\w\x\y\z"); |
| 40 } | 48 } |
| 41 } | 49 } |
| 50 |
| 42 main() { | 51 main() { |
| 43 RawStringTest.testMain(); | 52 RawStringTest.testMain(); |
| 44 } | 53 } |
| OLD | NEW |