Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(708)

Side by Side Diff: pkg/source_maps/test/parser_test.dart

Issue 421723004: Remove support for the old Span classes from source_maps. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Code review changes Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/source_maps/test/end2end_test.dart ('k') | pkg/source_maps/test/printer_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library test.parser_test; 5 library test.parser_test;
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 import 'package:source_maps/source_maps.dart'; 9 import 'package:source_maps/source_maps.dart';
10 import 'common.dart'; 10 import 'common.dart';
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 expect(entry.sourceUrlId, 0); 97 expect(entry.sourceUrlId, 0);
98 expect(entry.sourceColumn, 0); 98 expect(entry.sourceColumn, 0);
99 expect(entry.sourceLine, 0); 99 expect(entry.sourceLine, 0);
100 expect(entry.sourceNameId, 0); 100 expect(entry.sourceNameId, 0);
101 }); 101 });
102 102
103 test('parse with source root', () { 103 test('parse with source root', () {
104 var inputMap = new Map.from(MAP_WITH_SOURCE_LOCATION); 104 var inputMap = new Map.from(MAP_WITH_SOURCE_LOCATION);
105 inputMap['sourceRoot'] = '/pkg/'; 105 inputMap['sourceRoot'] = '/pkg/';
106 var mapping = parseJson(inputMap); 106 var mapping = parseJson(inputMap);
107 expect(mapping.spanFor(0, 0).sourceUrl, "/pkg/input.dart"); 107 expect(mapping.spanFor(0, 0).sourceUrl, Uri.parse("/pkg/input.dart"));
108 108
109 var newSourceRoot = '/new/'; 109 var newSourceRoot = '/new/';
110 110
111 mapping.sourceRoot = newSourceRoot; 111 mapping.sourceRoot = newSourceRoot;
112 inputMap["sourceRoot"] = newSourceRoot; 112 inputMap["sourceRoot"] = newSourceRoot;
113 113
114 expect(mapping.toJson(), equals(inputMap)); 114 expect(mapping.toJson(), equals(inputMap));
115 }); 115 });
116 116
117 test('parse and re-emit', () { 117 test('parse and re-emit', () {
118 for (var expected in [ 118 for (var expected in [
119 EXPECTED_MAP, 119 EXPECTED_MAP,
120 MAP_WITH_NO_SOURCE_LOCATION, 120 MAP_WITH_NO_SOURCE_LOCATION,
121 MAP_WITH_SOURCE_LOCATION, 121 MAP_WITH_SOURCE_LOCATION,
122 MAP_WITH_SOURCE_LOCATION_AND_NAME]) { 122 MAP_WITH_SOURCE_LOCATION_AND_NAME]) {
123 var mapping = parseJson(expected); 123 var mapping = parseJson(expected);
124 expect(mapping.toJson(), equals(expected)); 124 expect(mapping.toJson(), equals(expected));
125 } 125 }
126 }); 126 });
127 } 127 }
OLDNEW
« no previous file with comments | « pkg/source_maps/test/end2end_test.dart ('k') | pkg/source_maps/test/printer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698