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

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: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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 // Test optimized CodeUnitAt and array access. 5 // Test optimized CodeUnitAt and array access.
6 6
7 import "package:expect/expect.dart";
8
9
7 String one_byte = "hest"; 10 String one_byte = "hest";
8 String two_byte = "høns"; 11 String two_byte = "høns";
9 12
10 int testOneByteCodeUnitAt(String x, int j) { 13 int testOneByteCodeUnitAt(String x, int j) {
11 int test() { 14 int test() {
12 return x.codeUnitAt(j); 15 return x.codeUnitAt(j);
13 } 16 }
14 for (int i = 0; i < 10000; i++) test(); 17 for (int i = 0; i < 10000; i++) test();
15 return test(); 18 return test();
16 } 19 }
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 Expect.equals(248, testConstantStringCodeUnitAt(1)); 71 Expect.equals(248, testConstantStringCodeUnitAt(1));
69 Expect.equals(101, testConstantIndexCodeUnitAt(one_byte)); 72 Expect.equals(101, testConstantIndexCodeUnitAt(one_byte));
70 } 73 }
71 for (int j = 0; j < 2000; j++) { 74 for (int j = 0; j < 2000; j++) {
72 Expect.equals(436, testOneByteCodeUnitAtInLoop(one_byte)); 75 Expect.equals(436, testOneByteCodeUnitAtInLoop(one_byte));
73 Expect.equals(577, testTwoByteCodeUnitAtInLoop(two_byte)); 76 Expect.equals(577, testTwoByteCodeUnitAtInLoop(two_byte));
74 } 77 }
75 Expect.throws(() => testOneByteCodeUnitAtInLoop(123)); 78 Expect.throws(() => testOneByteCodeUnitAtInLoop(123));
76 Expect.throws(() => testTwoByteCodeUnitAtInLoop(123)); 79 Expect.throws(() => testTwoByteCodeUnitAtInLoop(123));
77 } 80 }
OLDNEW
« no previous file with comments | « tests/language/optimized_string_charat_test.dart ('k') | tests/language/optional_named_parameters_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698