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

Side by Side Diff: utils/tests/string_encoding/utf8_test.dart

Issue 11783009: Big merge from experimental to bleeding edge. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « utils/tests/string_encoding/utf32_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env dart 1 #!/usr/bin/env dart
2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 library utf8_tests; 6 library utf8_tests;
7 import 'dunit.dart'; 7 import 'dunit.dart';
8 import '../../../lib/utf/utf.dart'; 8 import '../../../lib/utf/utf.dart';
9 9
10 void main() { 10 void main() {
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 Expect.stringEquals(testGreekPhrase, 452 Expect.stringEquals(testGreekPhrase,
453 decodeUtf8(testGreekUtf8), "Greek"); 453 decodeUtf8(testGreekUtf8), "Greek");
454 454
455 Expect.stringEquals(testKatakanaPhrase, 455 Expect.stringEquals(testKatakanaPhrase,
456 decodeUtf8(testKatakanaUtf8), "Katakana"); 456 decodeUtf8(testKatakanaUtf8), "Katakana");
457 } 457 }
458 458
459 void testIterableMethods() { 459 void testIterableMethods() {
460 IterableUtf8Decoder englishDecoder = decodeUtf8AsIterable(testEnglishUtf8); 460 IterableUtf8Decoder englishDecoder = decodeUtf8AsIterable(testEnglishUtf8);
461 // get the first character 461 // get the first character
462 Expect.equals(testEnglishUtf8[0], englishDecoder.iterator().next()); 462 Expect.equals(testEnglishUtf8[0], englishDecoder.first);
463 // get the whole translation using the Iterable interface 463 // get the whole translation using the Iterable interface
464 Expect.stringEquals(testEnglishPhrase, 464 Expect.stringEquals(testEnglishPhrase,
465 new String.fromCharCodes(new List<int>.from(englishDecoder))); 465 new String.fromCharCodes(new List<int>.from(englishDecoder)));
466 466
467 IterableUtf8Decoder kataDecoder = decodeUtf8AsIterable(testKatakanaUtf8); 467 IterableUtf8Decoder kataDecoder = decodeUtf8AsIterable(testKatakanaUtf8);
468 // get the first character 468 // get the first character
469 Expect.equals(testKatakanaPhrase.charCodes[0], 469 Expect.equals(testKatakanaPhrase.charCodes[0], kataDecoder.first);
470 kataDecoder.iterator().next());
471 // get the whole translation using the Iterable interface 470 // get the whole translation using the Iterable interface
472 Expect.stringEquals(testKatakanaPhrase, 471 Expect.stringEquals(testKatakanaPhrase,
473 new String.fromCharCodes(new List<int>.from(kataDecoder))); 472 new String.fromCharCodes(new List<int>.from(kataDecoder)));
474 } 473 }
475 } 474 }
OLDNEW
« no previous file with comments | « utils/tests/string_encoding/utf32_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698