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

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

Issue 11316108: Correct file names for tests in tests/language. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: fixed status Created 8 years 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 // Test optimized charCodeAt and array access.
6
7 String one_byte = "hest";
8 String two_byte = "høns";
9
10 int testOneByteCharCodeAt(String x, int i) {
11 int test() {
12 return x.charCodeAt(i);
13 }
14 for (int i = 0; i < 10000; i++) test();
15 return test();
16 }
17
18
19 int testTwoByteCharCodeAt(String x, int i) {
20 int test() {
21 return x.charCodeAt(i);
22 }
23 for (int i = 0; i < 10000; i++) test();
24 return test();
25 }
26
27
28 int testConstantStringCharCodeAt(int i) {
29 int test() {
30 return "høns".charCodeAt(i);
31 }
32 for (int i = 0; i < 10000; i++) test();
33 return test();
34 }
35
36
37 int testConstantIndexCharCodeAt(String x) {
38 int test() {
39 return x.charCodeAt(1);
40 }
41 for (int i = 0; i < 10000; i++) test();
42 return test();
43 }
44
45
46 main() {
47 Expect.equals(101, testOneByteCharCodeAt(one_byte, 1));
48 Expect.equals(248, testTwoByteCharCodeAt(two_byte, 1));
49 Expect.equals(248, testConstantStringCharCodeAt(1));
50 Expect.equals(101, testConstantIndexCharCodeAt(one_byte));
51 }
OLDNEW
« no previous file with comments | « tests/language/optimized_lists_test.dart ('k') | tests/language/optimized_string_charcodeat_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698