Index: pkg/source_maps/test/parser_test.dart |
diff --git a/pkg/source_maps/test/parser_test.dart b/pkg/source_maps/test/parser_test.dart |
index 8f1be3dc5c710ffa67160f25bf6e5ff0c1b8f44e..62cd08f1f3700df8bef12c1d28d0043e0ed4d81c 100644 |
--- a/pkg/source_maps/test/parser_test.dart |
+++ b/pkg/source_maps/test/parser_test.dart |
@@ -100,6 +100,20 @@ main() { |
expect(entry.sourceNameId, 0); |
}); |
+ test('parse with source root', () { |
+ var inputMap = new Map.from(MAP_WITH_SOURCE_LOCATION); |
+ inputMap['sourceRoot'] = '/pkg/'; |
+ var mapping = parseJson(inputMap); |
+ expect(mapping.spanFor(0, 0).sourceUrl, "/pkg/input.dart"); |
+ |
+ var newSourceRoot = '/new/'; |
+ |
+ mapping.sourceRoot = newSourceRoot; |
+ inputMap["sourceRoot"] = newSourceRoot; |
+ |
+ expect(mapping.toJson(), equals(inputMap)); |
+ }); |
+ |
test('parse and re-emit', () { |
for (var expected in [ |
EXPECTED_MAP, |