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

Side by Side Diff: pkg/unittest/test/matchers_test.dart

Issue 11275042: Renaming IndexOutOfRangeException to RangeError. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 #library('matcherTest'); 5 #library('matcherTest');
6 #import('../../../pkg/unittest/unittest.dart'); 6 #import('../../../pkg/unittest/unittest.dart');
7 #source('test_utils.dart'); 7 #source('test_utils.dart');
8 8
9 doesNotThrow() {} 9 doesNotThrow() {}
10 doesThrow() { throw 'X'; } 10 doesThrow() { throw 'X'; }
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 test('throwsIllegalJSRegExpException', () { 108 test('throwsIllegalJSRegExpException', () {
109 shouldPass(() { throw new IllegalJSRegExpException('',''); }, 109 shouldPass(() { throw new IllegalJSRegExpException('',''); },
110 throwsIllegalJSRegExpException); 110 throwsIllegalJSRegExpException);
111 shouldFail(() { throw new Exception(); }, 111 shouldFail(() { throw new Exception(); },
112 throwsIllegalJSRegExpException, 112 throwsIllegalJSRegExpException,
113 "Expected: throws an exception which matches IllegalJSRegExpException " 113 "Expected: throws an exception which matches IllegalJSRegExpException "
114 "but: exception <Exception> does not match " 114 "but: exception <Exception> does not match "
115 "IllegalJSRegExpException."); 115 "IllegalJSRegExpException.");
116 }); 116 });
117 117
118 test('throwsIndexOutOfRangeException', () { 118 test('throwsRangeError', () {
119 shouldPass(() { throw new IndexOutOfRangeException(0); }, 119 shouldPass(() { throw new RangeError(0); },
120 throwsIndexOutOfRangeException); 120 throwsRangeError);
121 shouldFail(() { throw new Exception(); }, 121 shouldFail(() { throw new Exception(); },
122 throwsIndexOutOfRangeException, 122 throwsRangeError,
123 "Expected: throws an exception which matches IndexOutOfRangeException " 123 "Expected: throws an exception which matches RangeError "
124 "but: exception <Exception> does not match " 124 "but: exception <Exception> does not match "
125 "IndexOutOfRangeException."); 125 "RangeError.");
126 }); 126 });
127 127
128 test('throwsNoSuchMethodError', () { 128 test('throwsNoSuchMethodError', () {
129 shouldPass(() { throw new NoSuchMethodError(null, '', null); }, 129 shouldPass(() { throw new NoSuchMethodError(null, '', null); },
130 throwsNoSuchMethodError); 130 throwsNoSuchMethodError);
131 shouldFail(() { throw new Exception(); }, 131 shouldFail(() { throw new Exception(); },
132 throwsNoSuchMethodError, 132 throwsNoSuchMethodError,
133 "Expected: throws an exception which matches NoSuchMethodError " 133 "Expected: throws an exception which matches NoSuchMethodError "
134 "but: exception <Exception> does not match " 134 "but: exception <Exception> does not match "
135 "NoSuchMethodError."); 135 "NoSuchMethodError.");
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 test('isInstanceOf', () { 519 test('isInstanceOf', () {
520 shouldFail(0, predicate((x) => x is String, 520 shouldFail(0, predicate((x) => x is String,
521 description: "an instance of String"), 521 description: "an instance of String"),
522 "Expected: an instance of String but: was <0>."); 522 "Expected: an instance of String but: was <0>.");
523 shouldPass('cow', predicate((x) => x is String, 523 shouldPass('cow', predicate((x) => x is String,
524 description: "an instance of String")); 524 description: "an instance of String"));
525 }); 525 });
526 }); 526 });
527 } 527 }
528 528
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698