OLD | NEW |
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 // VMOptions=--optimization-counter-threshold=10 --no-use-osr | 4 // VMOptions=--optimization-counter-threshold=10 --no-use-osr --no-background-co
mpilation |
5 | 5 |
6 import "package:expect/expect.dart"; | 6 import "package:expect/expect.dart"; |
7 | 7 |
8 // Test optimized [] on strings. | 8 // Test optimized [] on strings. |
9 | 9 |
10 var a = "abc"; | 10 var a = "abc"; |
11 var b = "øbc"; | 11 var b = "øbc"; |
12 var c = new String.fromCharCodes([123, 456, 789]); | 12 var c = new String.fromCharCodes([123, 456, 789]); |
13 | 13 |
14 test_charat(s, i) { | 14 test_charat(s, i) { |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 Expect.equals(new String.fromCharCodes([123]), test_charat(c, 0)); | 60 Expect.equals(new String.fromCharCodes([123]), test_charat(c, 0)); |
61 for (var i = 0; i < 20; i++) test_charat(c, 0); | 61 for (var i = 0; i < 20; i++) test_charat(c, 0); |
62 Expect.equals(new String.fromCharCodes([123]), test_charat(c, 0)); | 62 Expect.equals(new String.fromCharCodes([123]), test_charat(c, 0)); |
63 Expect.equals(new String.fromCharCodes([456]), test_charat(c, 1)); | 63 Expect.equals(new String.fromCharCodes([456]), test_charat(c, 1)); |
64 Expect.equals(new String.fromCharCodes([789]), test_charat(c, 2)); | 64 Expect.equals(new String.fromCharCodes([789]), test_charat(c, 2)); |
65 Expect.throws(() => test_charat(c, 3)); | 65 Expect.throws(() => test_charat(c, 3)); |
66 | 66 |
67 | 67 |
68 } | 68 } |
OLD | NEW |