Migrate for deprecations from other packages (#36)
diff --git a/test/common.dart b/test/common.dart
index 8217c0e..ef119ec 100644
--- a/test/common.dart
+++ b/test/common.dart
@@ -19,7 +19,7 @@
return longVar1 + longVar2;
}
''';
-var input = SourceFile(INPUT, url: 'input.dart');
+var input = SourceFile.fromString(INPUT, url: 'input.dart');
/// A span in the input file
SourceMapSpan ispan(int start, int end, [bool isIdentifier = false]) =>
@@ -40,7 +40,7 @@
var x = 3;
f(y) => x + y;
''';
-var output = SourceFile(OUTPUT, url: 'output.dart');
+var output = SourceFile.fromString(OUTPUT, url: 'output.dart');
/// A span in the output file
SourceMapSpan ospan(int start, int end, [bool isIdentifier = false]) =>
diff --git a/test/end2end_test.dart b/test/end2end_test.dart
index 5d60165..28c6625 100644
--- a/test/end2end_test.dart
+++ b/test/end2end_test.dart
@@ -107,7 +107,7 @@
test('printer projecting marks + parse', () {
var out = INPUT.replaceAll('long', '_s');
- var file = SourceFile(out, url: 'output2.dart');
+ var file = SourceFile.fromString(out, url: 'output2.dart');
var printer = Printer('output2.dart');
printer.mark(ispan(0, 0));
diff --git a/test/parser_test.dart b/test/parser_test.dart
index d6a8ac1..6b2f557 100644
--- a/test/parser_test.dart
+++ b/test/parser_test.dart
@@ -238,7 +238,7 @@
});
test('missing path', () {
- expect(() => mapping.spanFor(0, 0), throws);
+ expect(() => mapping.spanFor(0, 0), throwsA(anything));
});
test('incomplete paths', () {
@@ -336,7 +336,7 @@
expect(mapping.toJson(), equals(expected));
}
// Invalid for this case
- expect(() => parseJson(SOURCE_MAP_BUNDLE as dynamic), throws);
+ expect(() => parseJson(SOURCE_MAP_BUNDLE as dynamic), throwsA(anything));
var mapping = parseJsonExtended(SOURCE_MAP_BUNDLE) as MappingBundle;
expect(mapping.toJson(), equals(SOURCE_MAP_BUNDLE));
diff --git a/test/refactor_test.dart b/test/refactor_test.dart
index ba2ddc9..552081a 100644
--- a/test/refactor_test.dart
+++ b/test/refactor_test.dart
@@ -17,7 +17,7 @@
group('conflict detection', () {
var original = "0123456789abcdefghij";
- var file = SourceFile(original);
+ var file = SourceFile.fromString(original);
test('no conflict, in order', () {
var txn = TextEditTransaction(original, file);
@@ -54,7 +54,7 @@
test('generated source maps', () {
var original =
"0123456789\n0*23456789\n01*3456789\nabcdefghij\nabcd*fghij\n";
- var file = SourceFile(original);
+ var file = SourceFile.fromString(original);
var txn = TextEditTransaction(original, file);
txn.edit(27, 29, '__\n ');
txn.edit(34, 35, '___');
diff --git a/test/vlq_test.dart b/test/vlq_test.dart
index 30b6d45..f97989f 100644
--- a/test/vlq_test.dart
+++ b/test/vlq_test.dart
@@ -37,17 +37,17 @@
expect(encodeVlq(min_int).join(''), 'hgggggE');
expect(decodeVlq('hgggggE'.split('').iterator), min_int);
- expect(() => encodeVlq(max_int + 1), throws);
- expect(() => encodeVlq(max_int + 2), throws);
- expect(() => encodeVlq(min_int - 1), throws);
- expect(() => encodeVlq(min_int - 2), throws);
+ expect(() => encodeVlq(max_int + 1), throwsA(anything));
+ expect(() => encodeVlq(max_int + 2), throwsA(anything));
+ expect(() => encodeVlq(min_int - 1), throwsA(anything));
+ expect(() => encodeVlq(min_int - 2), throwsA(anything));
// if we allowed more than 32 bits, these would be the expected encodings
// for the large numbers above.
- expect(() => decodeVlq('ggggggE'.split('').iterator), throws);
- expect(() => decodeVlq('igggggE'.split('').iterator), throws);
- expect(() => decodeVlq('jgggggE'.split('').iterator), throws);
- expect(() => decodeVlq('lgggggE'.split('').iterator), throws);
+ expect(() => decodeVlq('ggggggE'.split('').iterator), throwsA(anything));
+ expect(() => decodeVlq('igggggE'.split('').iterator), throwsA(anything));
+ expect(() => decodeVlq('jgggggE'.split('').iterator), throwsA(anything));
+ expect(() => decodeVlq('lgggggE'.split('').iterator), throwsA(anything));
},
// This test uses integers so large they overflow in JS.
testOn: "dart-vm");