Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
Migrate off deprecated isInstanceOf (#40)
Browse files Browse the repository at this point in the history
- Bump `package:test` to `1.6.0` which introduce `isA`.
- Use `2.1.0` SDK on travis since it's the minimum supported by `test`.
- Bump min SDK in the pubspec to `2.1.0` to match what is tested.
- Replace `new isInstanceOf` with `isA`.
  • Loading branch information
natebosch authored Nov 7, 2019
1 parent 885c710 commit b43be75
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: dart

dart:
- dev
- 2.0.0
- 2.1.0

dart_task:
- test: --platform vm,chrome
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ author: Dart Team <[email protected]>
homepage: https://github.com/dart-lang/source_span

environment:
sdk: '>=2.0.0 <3.0.0'
sdk: '>=2.1.0 <3.0.0'

dependencies:
charcode: ^1.0.0
path: '>=1.2.0 <2.0.0'
term_glyph: ^1.0.0

dev_dependencies:
test: ^1.0.0
test: ^1.6.0
6 changes: 3 additions & 3 deletions test/file_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ zip zap zop""", url: "bar.dart").span(10, 11);
test("pointSpan() returns a FileSpan", () {
var location = file.location(15);
var span = location.pointSpan();
expect(span, new isInstanceOf<FileSpan>());
expect(span, isA<FileSpan>());
expect(span.start, equals(location));
expect(span.end, equals(location));
expect(span.text, isEmpty);
Expand Down Expand Up @@ -344,14 +344,14 @@ zip zap zop
});

test("returns a FileSpan for a FileSpan input", () {
expect(span.union(file.span(0, 5)), new isInstanceOf<FileSpan>());
expect(span.union(file.span(0, 5)), isA<FileSpan>());
});

test("returns a base SourceSpan for a SourceSpan input", () {
var other = new SourceSpan(new SourceLocation(0, sourceUrl: "foo.dart"),
new SourceLocation(5, sourceUrl: "foo.dart"), "hey, ");
var result = span.union(other);
expect(result, isNot(new isInstanceOf<FileSpan>()));
expect(result, isNot(isA<FileSpan>()));
expect(result.start, equals(other.start));
expect(result.end, equals(span.end));
expect(result.text, equals("hey, ar baz\n"));
Expand Down

0 comments on commit b43be75

Please sign in to comment.