OLD | NEW |
(Empty) | |
| 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 |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // Dart test for reading escape sequences in string literals |
| 5 // This test explicitly checks for handling for 4 byte unicode. |
| 6 |
| 7 class CharEscapeVMTest { |
| 8 static testMain() { |
| 9 var v10000 = "\u{10000}"; |
| 10 var v010000 = "\u{010000}"; |
| 11 Expect.equals(1, v10000.length); |
| 12 Expect.equals(1, v010000.length); |
| 13 Expect.equals("\u{10000}", new String.fromCharCodes([0x10000])); |
| 14 Expect.equals("\u{010000}", new String.fromCharCodes([0x10000])); |
| 15 |
| 16 |
| 17 var v1FFFF = "\u{1FFFF}"; |
| 18 var v01FFFF = "\u{01FFFF}"; |
| 19 Expect.equals(1, v1FFFF.length); |
| 20 Expect.equals(1, v01FFFF.length); |
| 21 Expect.equals("\u{1FFFF}", new String.fromCharCodes([0x1FFFF])); |
| 22 Expect.equals("\u{01FFFF}", new String.fromCharCodes([0x1FFFF])); |
| 23 |
| 24 var v105555 = "\u{105555}"; |
| 25 Expect.equals(1, v105555.length); |
| 26 Expect.equals("\u{105555}", new String.fromCharCodes([0x105555])); |
| 27 |
| 28 var v10FFFF = "\u{10FFFF}"; |
| 29 Expect.equals(1, v10FFFF.length); |
| 30 Expect.equals("\u{10FFFF}", new String.fromCharCodes([0x10FFFF])); |
| 31 } |
| 32 } |
| 33 |
| 34 main() { |
| 35 CharEscapeVMTest.testMain(); |
| 36 } |
OLD | NEW |