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

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

Issue 12282038: Remove deprecated string features. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head Created 7 years, 9 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/dunit.dart ('k') | utils/tests/string_encoding/utf16_test.dart » ('j') | 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 unicode_tests; 6 library unicode_tests;
7 import 'dunit.dart'; 7 import 'dunit.dart';
8 import '../../../lib/utf/utf.dart'; 8 import '../../../sdk/lib/utf/utf.dart';
9 9
10 void main() { 10 void main() {
11 TestSuite suite = new TestSuite(); 11 TestSuite suite = new TestSuite();
12 suite.registerTestClass(new UnicodeTests()); 12 suite.registerTestClass(new UnicodeTests());
13 suite.run(); 13 suite.run();
14 } 14 }
15 15
16 class UnicodeTests extends TestClass { 16 class UnicodeTests extends TestClass {
17 static const String testPhrase = 17 static const String testPhrase =
18 "The quick brown fox jumps over the lazy dog."; 18 "The quick brown fox jumps over the lazy dog.";
19 19
20 static const List<int> testCodepoints = const<int> [ 20 static const List<int> testCodepoints = const<int> [
21 84, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110, 21 84, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110,
22 32, 102, 111, 120, 32, 106, 117, 109, 112, 115, 32, 111, 118, 101, 114, 22 32, 102, 111, 120, 32, 106, 117, 109, 112, 115, 32, 111, 118, 101, 114,
23 32, 116, 104, 101, 32, 108, 97, 122, 121, 32, 100, 111, 103, 46]; 23 32, 116, 104, 101, 32, 108, 97, 122, 121, 32, 100, 111, 103, 46];
24 24
25 void registerTests(TestSuite suite) { 25 void registerTests(TestSuite suite) {
26 register("testCodepointsToString", testCodepointsToString, suite); 26 register("testCodepointsToString", testCodepointsToString, suite);
27 register("testStringCharCodes", testStringCharCodes, suite); 27 register("testStringCharCodes", testStringCharCodes, suite);
28 register("testEmptyStringFromCharCodes", testEmptyStringFromCharCodes, suite ); 28 register("testEmptyStringFromCharCodes", testEmptyStringFromCharCodes, suite );
29 register("testEmptyStringCharCodes", testEmptyStringCharCodes, suite); 29 register("testEmptyStringCharCodes", testEmptyStringCharCodes, suite);
30 } 30 }
31 31
32 void testStringCharCodes() { 32 void testStringCharCodes() {
33 Expect.listEquals(testCodepoints, testPhrase.charCodes()); 33 Expect.listEquals(testCodepoints, testPhrase.codeUnits);
34 } 34 }
35 35
36 void testCodepointsToString() { 36 void testCodepointsToString() {
37 Expect.stringEquals(testPhrase, new String.fromCharCodes(testCodepoints)); 37 Expect.stringEquals(testPhrase, new String.fromCharCodes(testCodepoints));
38 } 38 }
39 39
40 void testEmptyStringFromCharCodes() { 40 void testEmptyStringFromCharCodes() {
41 Expect.stringEquals("", new String.fromCharCodes(<int>[])); 41 Expect.stringEquals("", new String.fromCharCodes(<int>[]));
42 } 42 }
43 43
44 void testEmptyStringCharCodes() { 44 void testEmptyStringCharCodes() {
45 Expect.listEquals([], "".charCodes()); 45 Expect.listEquals([], "".codeUnits);
46 } 46 }
47 } 47 }
OLDNEW
« no previous file with comments | « utils/tests/string_encoding/dunit.dart ('k') | utils/tests/string_encoding/utf16_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698