Skip to content

Commit

Permalink
Allow SDK versions to <3.0.0 (flutter#99)
Browse files Browse the repository at this point in the history
Fix some deprecated usages in tests.
  • Loading branch information
chalin authored and natebosch committed Jul 18, 2018
1 parent 6b66e9b commit 7e9f730
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.14.11

* Set max SDK version to `<3.0.0`.

## 1.14.10

* Fix the parameter names in overridden methods to match the source.
Expand Down
1 change: 0 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
analyzer:
strong-mode: true
errors:
unused_element: error
unused_import: error
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
name: collection
version: 1.14.11-dev
author: Dart Team <misc@dartlang.org>
version: 1.14.11

description: Collections and utilities functions and classes related to collections.
author: Dart Team <misc@dartlang.org>
homepage: https://www.github.com/dart-lang/collection

environment:
# Required for Dart 2.0 collection changes.
sdk: '>=2.0.0-dev.55.0 <2.0.0'
sdk: '>=2.0.0-dev.55.0 <3.0.0'

dev_dependencies:
build_runner: ^0.9.0
Expand Down
3 changes: 1 addition & 2 deletions test/priority_queue_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ void main() {

void testDefault() {
test('new PriorityQueue() returns a HeapPriorityQueue', () {
expect(
new PriorityQueue<int>(), new isInstanceOf<HeapPriorityQueue<int>>());
expect(new PriorityQueue<int>(), new TypeMatcher<HeapPriorityQueue<int>>());
});
testInt(() => new PriorityQueue<int>());
testCustom((comparator) => new PriorityQueue<C>(comparator));
Expand Down
6 changes: 3 additions & 3 deletions test/queue_list_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void main() {
stringQueue.addAll(['c', 'd']);
expect(
stringQueue,
const isInstanceOf<QueueList<String>>(),
const TypeMatcher<QueueList<String>>(),
reason: 'Expected QueueList<String>, got ${stringQueue.runtimeType}',
skip: isDart2 ? false : 'Cast does nothing in Dart1',
);
Expand All @@ -278,7 +278,7 @@ void main() {
var numQueue = stringQueue.cast<num>();
expect(
numQueue,
const isInstanceOf<QueueList<num>>(),
const TypeMatcher<QueueList<num>>(),
reason: 'Expected QueueList<num>, got ${numQueue.runtimeType}',
skip: isDart2 ? false : 'Cast does nothing in Dart1',
);
Expand Down Expand Up @@ -318,4 +318,4 @@ QueueList withInternalGap() {
/// Returns a matcher that expects that a closure throws a
/// [ConcurrentModificationError].
final throwsConcurrentModificationError =
throwsA(new isInstanceOf<ConcurrentModificationError>());
throwsA(new TypeMatcher<ConcurrentModificationError>());
2 changes: 1 addition & 1 deletion test/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import "package:test/test.dart";

final Matcher throwsCastError = throwsA(new isInstanceOf<CastError>());
final Matcher throwsCastError = throwsA(new TypeMatcher<CastError>());

/// A hack to determine whether we are running in a Dart 2 runtime.
final bool isDart2 = _isTypeArgString('');
Expand Down

0 comments on commit 7e9f730

Please sign in to comment.