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

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

Issue 1289713002: Enable analyzer tests after fixing them for analysis (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 bool noSuchMethod(Invocation im) {} // To appease dartanalyzer.
11 } 12 }
12 13
13 class EvilIterator implements Iterator { 14 class EvilIterator implements Iterator {
14 bool moveNext() => true; 15 bool moveNext() => true;
15 EvilMatch get current => new EvilMatch(); 16 EvilMatch get current => new EvilMatch();
16 } 17 }
17 18
18 class EvilIterable extends Iterable { 19 class EvilIterable extends Iterable {
19 Iterator get iterator => new EvilIterator(); 20 Iterator get iterator => new EvilIterator();
20 } 21 }
21 22
22 class EvilPattern implements Pattern { 23 class EvilPattern implements Pattern {
23 Iterable allMatches(String s) => new EvilIterable(); 24 Iterable allMatches(String s, [int start=0]) => new EvilIterable();
25 bool noSuchMethod(Invocation im) {} // To appease dartanalyzer.
24 } 26 }
25 27
26 void main() { 28 void main() {
27 Expect.throws(() => "foo".split(new EvilPattern())[0].length, 29 Expect.throws(() => "foo".split(new EvilPattern())[0].length,
28 (e) => e is RangeError); 30 (e) => e is RangeError);
29 } 31 }
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