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

Side by Side Diff: tests/corelib/unicode2_test.dart

Issue 68563004: Move unicode tests to utf package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Simplify test. Created 7 years, 1 month 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 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
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.
4
5 import 'package:expect/expect.dart';
6
7 const String testPhrase =
8 "The quick brown fox jumps over the lazy dog.";
9
10 const List<int> testCodepoints = const<int> [
11 84, 104, 101, 32, 113, 117, 105, 99, 107, 32, 98, 114, 111, 119, 110,
12 32, 102, 111, 120, 32, 106, 117, 109, 112, 115, 32, 111, 118, 101, 114,
13 32, 116, 104, 101, 32, 108, 97, 122, 121, 32, 100, 111, 103, 46];
14
15 main() {
16 testCodepointsToString();
17 testStringCharCodes();
18 testEmptyStringFromCharCodes();
19 testEmptyStringCharCodes();
20 }
21
22 void testStringCharCodes() {
23 Expect.listEquals(testCodepoints, testPhrase.codeUnits);
24 }
25
26 void testCodepointsToString() {
27 Expect.stringEquals(testPhrase, new String.fromCharCodes(testCodepoints));
28 }
29
30 void testEmptyStringFromCharCodes() {
31 Expect.stringEquals("", new String.fromCharCodes(<int>[]));
32 }
33
34 void testEmptyStringCharCodes() {
35 Expect.listEquals([], "".codeUnits);
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698