diff --git a/.analysis_options b/analysis_options.yaml similarity index 100% rename from .analysis_options rename to analysis_options.yaml diff --git a/test/async/concat_test.dart b/test/async/concat_test.dart index 3b70bfd4..704a2bb6 100644 --- a/test/async/concat_test.dart +++ b/test/async/concat_test.dart @@ -96,7 +96,7 @@ main() { var data = [], errors = []; var badIteration = ['e', 'this should not get thrown'].map((message) => throw message); - var concatenated = concat(badIteration as Iterable); + var concatenated = concat(badIteration); var completer = new Completer(); concatenated.listen(data.add, onError: errors.add, onDone: completer.complete); diff --git a/test/async/future_group_test.dart b/test/async/future_group_test.dart index f883fe10..bff8fc33 100644 --- a/test/async/future_group_test.dart +++ b/test/async/future_group_test.dart @@ -54,7 +54,7 @@ main() { group.add(completer1.future); completer1.complete(1); return new Future(() { - expect(() => group.add(completer2.future), throws); + expect(() => group.add(completer2.future), throwsStateError); }); }); }); diff --git a/test/async/iteration_test.dart b/test/async/iteration_test.dart index 5eaf245c..3c73907d 100644 --- a/test/async/iteration_test.dart +++ b/test/async/iteration_test.dart @@ -92,12 +92,13 @@ main() { }); test('should validate maxTasks', () { - expect(() => forEachAsync([], (i) {}, maxTasks: null), throws); - expect(() => forEachAsync([], (i) {}, maxTasks: 0), throws); + expect( + () => forEachAsync([], (i) {}, maxTasks: null), throwsArgumentError); + expect(() => forEachAsync([], (i) {}, maxTasks: 0), throwsArgumentError); }); test('should validate iterable', () { - expect(() => forEachAsync(null, (i) {}), throws); + expect(() => forEachAsync(null, (i) {}), throwsArgumentError); }); test('should complete when given no work', () { diff --git a/test/collection/delegates/iterable_test.dart b/test/collection/delegates/iterable_test.dart index 39e32735..883e6b91 100644 --- a/test/collection/delegates/iterable_test.dart +++ b/test/collection/delegates/iterable_test.dart @@ -130,13 +130,14 @@ void main() { }); test('single', () { - expect(() => delegatingIterable.single, throws); + expect(() => delegatingIterable.single, throwsStateError); expect(new MyIterable(['a']).single, equals('a')); }); test('singleWhere', () { expect(delegatingIterable.singleWhere((e) => e == 'b'), equals('b')); - expect(() => delegatingIterable.singleWhere((e) => e == 'd'), throws); + expect(() => delegatingIterable.singleWhere((e) => e == 'd'), + throwsStateError); }); test('skip', () { diff --git a/test/collection/delegates/list_test.dart b/test/collection/delegates/list_test.dart index de48e5db..8727d406 100644 --- a/test/collection/delegates/list_test.dart +++ b/test/collection/delegates/list_test.dart @@ -37,7 +37,7 @@ void main() { expect(delegatingList[0], equals('a')); expect(delegatingList[1], equals('b')); expect(delegatingList[2], equals('cc')); - expect(() => delegatingList[3], throws); + expect(() => delegatingList[3], throwsRangeError); }); test('[]=', () { diff --git a/test/core/optional_test.dart b/test/core/optional_test.dart index df615669..f1a71282 100644 --- a/test/core/optional_test.dart +++ b/test/core/optional_test.dart @@ -21,7 +21,7 @@ main() { group('Optional', () { test('absent should be not present and not gettable', () { expect(new Optional.absent().isPresent, isFalse); - expect(() => new Optional.absent().value, throws); + expect(() => new Optional.absent().value, throwsStateError); }); test('of should return value', () { diff --git a/test/iterables/concat_test.dart b/test/iterables/concat_test.dart index 003ea7d9..fa01d140 100644 --- a/test/iterables/concat_test.dart +++ b/test/iterables/concat_test.dart @@ -41,7 +41,7 @@ main() { }); test('should throw for null input', () { - expect(() => concat(null), throws); + expect(() => concat(null), throwsNoSuchMethodError); }); test('should throw if any input is null', () { @@ -51,7 +51,7 @@ main() { null, [3, 4] ]).toList(), - throws); + throwsNoSuchMethodError); }); test('should reflectchanges in the inputs', () { diff --git a/test/iterables/enumerate_test.dart b/test/iterables/enumerate_test.dart index eda5cddc..3ec7d9ff 100644 --- a/test/iterables/enumerate_test.dart +++ b/test/iterables/enumerate_test.dart @@ -56,7 +56,7 @@ main() { expect(e.single.index, 0); expect(e.single.value, 'a'); - expect(() => enumerate([1, 2]).single, throws); + expect(() => enumerate([1, 2]).single, throwsStateError); }); test("length", () { diff --git a/test/iterables/merge_test.dart b/test/iterables/merge_test.dart index ee2ab3a8..d2b7a116 100644 --- a/test/iterables/merge_test.dart +++ b/test/iterables/merge_test.dart @@ -61,8 +61,8 @@ main() { test("should throw on null elements", () { var a = ['a', null, 'c']; var b = ['a', 'b', 'c']; - expect(() => merge([a, b]).forEach((e) {}), throws); - expect(() => merge([b, a]).forEach((e) {}), throws); + expect(() => merge([a, b]).forEach((e) {}), throwsNoSuchMethodError); + expect(() => merge([b, a]).forEach((e) {}), throwsNoSuchMethodError); }); test("should handle zig-zag case", () { diff --git a/test/iterables/range_test.dart b/test/iterables/range_test.dart index 9748dbbc..5f003f30 100644 --- a/test/iterables/range_test.dart +++ b/test/iterables/range_test.dart @@ -47,11 +47,11 @@ main() { }); test("should throw with a bad range", () { - expect(() => range(10, 0), throws); + expect(() => range(10, 0), throwsArgumentError); }); test("should throw with a bad step", () { - expect(() => range(0, 10, -1), throws); + expect(() => range(0, 10, -1), throwsArgumentError); }); }); } diff --git a/test/strings_test.dart b/test/strings_test.dart index f75c6a81..4c614a96 100644 --- a/test/strings_test.dart +++ b/test/strings_test.dart @@ -140,10 +140,10 @@ main() { // Corner cases test('should throw on null', () { - expect(() => loop(null, 6, 8), throws); + expect(() => loop(null, 6, 8), throwsArgumentError); }); test('should throw on empty', () { - expect(() => loop('', 6, 8), throws); + expect(() => loop('', 6, 8), throwsArgumentError); }); });