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 import "package:expect/expect.dart"; | 5 import "package:expect/expect.dart"; |
6 | 6 |
7 main() { | 7 main() { |
8 test(String s) { | 8 test(String s) { |
9 List<int> units = s.codeUnits; | 9 List<int> units = s.codeUnits; |
10 List<int> expectedUnits = <int>[]; | 10 List<int> expectedUnits = <int>[]; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 test(string); | 71 test(string); |
72 | 72 |
73 // Reading each unit of a surrogate pair works. | 73 // Reading each unit of a surrogate pair works. |
74 var r = "\u{10000}".codeUnits; | 74 var r = "\u{10000}".codeUnits; |
75 var it = r.iterator; | 75 var it = r.iterator; |
76 Expect.isTrue(it.moveNext()); | 76 Expect.isTrue(it.moveNext()); |
77 Expect.equals(0xD800, it.current); | 77 Expect.equals(0xD800, it.current); |
78 Expect.isTrue(it.moveNext()); | 78 Expect.isTrue(it.moveNext()); |
79 Expect.equals(0xDC00, it.current); | 79 Expect.equals(0xDC00, it.current); |
80 } | 80 } |
OLD | NEW |