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

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

Issue 9233041: String encoding utility methods and tests for Unicode, UTF-8, -16 and -32. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: remove notes to self Created 8 years, 10 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
(Empty)
1 #!/usr/bin/env dart
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
4 // BSD-style license that can be found in the LICENSE file.
5
6 #library("UnicodeTests");
7 #import("DUnit.dart");
8 #import("../../string_encoding/Unicode.dart");
9
10 void main() {
11 TestSuite suite = new TestSuite();
12 suite.registerTestClass(new UnicodeTests());
13 suite.run();
14 }
15
16 class UnicodeTests extends TestClass {
17 void registerTests(TestSuite suite) {
18 register("testCodepointsToString", testCodepointsToString, suite);
19 register("testStringToCodepoints", testStringToCodepoints, suite);
20 }
21
22 void testStringToCodepoints() {
23 Expect.listEquals([
24 84, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110,
25 32, 102, 111, 120, 32, 106, 117, 109, 112, 115, 32, 111, 118, 101, 114,
26 32, 116, 104, 101, 32, 108, 97, 122, 121, 32, 100, 111, 103, 46],
27 stringToCodepoints("The quick brown fox jumps over the lazy dog."));
28 }
29
30 void testCodepointsToString() {
31 Expect.listEquals("The quick brown fox jumps over the lazy dog.",
32 codepointsToString([
33 84, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98, 114, 111,
34 119, 110, 32, 102, 111, 120, 32, 106, 117, 109, 112, 115,
35 32, 111, 118, 101, 114,32, 116, 104, 101, 32, 108, 97, 122,
36 121, 32, 100, 111, 103, 46]));
37 }
38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698