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

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

Issue 1291563002: Fix test breakage in checked mode (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « tests/language/string_interpolation_and_buffer_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Issue 24043. 4 // Issue 24043.
5 5
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 class EvilMatch implements Match { 8 class EvilMatch implements Match {
9 int get start => 100000000; 9 int get start => 100000000;
10 int get end => 3; 10 int get end => 3;
11 } 11 }
12 12
13 class EvilIterator implements Iterator { 13 class EvilIterator implements Iterator {
14 bool moveNext() => true; 14 bool moveNext() => true;
15 EvilMatch get current => new EvilMatch(); 15 EvilMatch get current => new EvilMatch();
16 } 16 }
17 17
18 class EvilIterable extends Iterable { 18 class EvilIterable extends Iterable {
19 Iterator get iterator => new EvilIterator(); 19 Iterator get iterator => new EvilIterator();
20 } 20 }
21 21
22 class EvilPattern { 22 class EvilPattern implements Pattern {
23 Iterable allMatches(String s) => new EvilIterable(); 23 Iterable allMatches(String s) => new EvilIterable();
24 } 24 }
25 25
26 void main() { 26 void main() {
27 Expect.throws(() => "foo".split(new EvilPattern())[0].length, 27 Expect.throws(() => "foo".split(new EvilPattern())[0].length,
28 (e) => e is RangeError); 28 (e) => e is RangeError);
29 } 29 }
OLDNEW
« no previous file with comments | « tests/language/string_interpolation_and_buffer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698