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

Side by Side Diff: tests/language/optimized_string_charcodeat_test.dart

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 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 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 import "package:expect/expect.dart";
6
5 // Test optimized charCodeAt and array access. 7 // Test optimized charCodeAt and array access.
6 8
7 String one_byte = "hest"; 9 String one_byte = "hest";
8 String two_byte = "høns"; 10 String two_byte = "høns";
9 11
10 int testOneByteCharCodeAt(String x, int i) { 12 int testOneByteCharCodeAt(String x, int i) {
11 int test() { 13 int test() {
12 return x.charCodeAt(i); 14 return x.charCodeAt(i);
13 } 15 }
14 for (int i = 0; i < 10000; i++) test(); 16 for (int i = 0; i < 10000; i++) test();
(...skipping 27 matching lines...) Expand all
42 return test(); 44 return test();
43 } 45 }
44 46
45 47
46 main() { 48 main() {
47 Expect.equals(101, testOneByteCharCodeAt(one_byte, 1)); 49 Expect.equals(101, testOneByteCharCodeAt(one_byte, 1));
48 Expect.equals(248, testTwoByteCharCodeAt(two_byte, 1)); 50 Expect.equals(248, testTwoByteCharCodeAt(two_byte, 1));
49 Expect.equals(248, testConstantStringCharCodeAt(1)); 51 Expect.equals(248, testConstantStringCharCodeAt(1));
50 Expect.equals(101, testConstantIndexCharCodeAt(one_byte)); 52 Expect.equals(101, testConstantIndexCharCodeAt(one_byte));
51 } 53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698