Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: tests/lib/convert/utf83_test.dart

Issue 19883003: Add chunked conversion to converters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Improve some typse. Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698