Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
|
Søren Gjesse
2013/07/24 09:26:41
No need for this change.
floitsch
2013/07/24 18:31:15
Done.
| |
| 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 library utf8_test; | 5 library utf8_test; |
| 6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
| 7 import 'dart:convert'; | 7 import 'dart:convert'; |
| 8 | 8 |
| 9 main() { | 9 main() { |
| 10 // Test that UTF8-decoder removes leading BOM. | 10 // Test that UTF8-decoder removes leading BOM. |
| 11 Expect.equals("a", UTF8.decode([0xEF, 0xBB, 0xBF, 0x61])); | 11 Expect.equals("a", UTF8.decode([0xEF, 0xBB, 0xBF, 0x61])); |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 36 new Utf8Decoder().convert([0x61, 0xEF, 0xBB, 0xBF])); | 36 new Utf8Decoder().convert([0x61, 0xEF, 0xBB, 0xBF])); |
| 37 Expect.equals("a\u{FEFF}", | 37 Expect.equals("a\u{FEFF}", |
| 38 UTF8.decode([0x61, 0xEF, 0xBB, 0xBF], allowMalformed: true)); | 38 UTF8.decode([0x61, 0xEF, 0xBB, 0xBF], allowMalformed: true)); |
| 39 Expect.equals("a\u{FEFF}", new Utf8Codec(allowMalformed: true) | 39 Expect.equals("a\u{FEFF}", new Utf8Codec(allowMalformed: true) |
| 40 .decode([0x61, 0xEF, 0xBB, 0xBF])); | 40 .decode([0x61, 0xEF, 0xBB, 0xBF])); |
| 41 Expect.equals("a\u{FEFF}", new Utf8Codec(allowMalformed: true) | 41 Expect.equals("a\u{FEFF}", new Utf8Codec(allowMalformed: true) |
| 42 .decoder.convert([0x61, 0xEF, 0xBB, 0xBF])); | 42 .decoder.convert([0x61, 0xEF, 0xBB, 0xBF])); |
| 43 Expect.equals("a\u{FEFF}", new Utf8Decoder(allowMalformed: true) | 43 Expect.equals("a\u{FEFF}", new Utf8Decoder(allowMalformed: true) |
| 44 .convert([0x61, 0xEF, 0xBB, 0xBF])); | 44 .convert([0x61, 0xEF, 0xBB, 0xBF])); |
| 45 } | 45 } |
| OLD | NEW |