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

Unified Diff: pkg/source_maps/test/common.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, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/source_maps/test/builder_test.dart ('k') | pkg/source_maps/test/end2end_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/source_maps/test/common.dart
diff --git a/pkg/source_maps/test/common.dart b/pkg/source_maps/test/common.dart
index 0c1f28a74166f980ec8eb561618b307cc0f45d34..73a8d406b98cd9bb12f0c3d8efd6421b28e75db4 100644
--- a/pkg/source_maps/test/common.dart
+++ b/pkg/source_maps/test/common.dart
@@ -6,6 +6,7 @@
library test.common;
import 'package:source_maps/source_maps.dart';
+import 'package:source_span/source_span.dart';
import 'package:unittest/unittest.dart';
/// Content of the source file
@@ -18,40 +19,40 @@ int longName(int longVar2) {
return longVar1 + longVar2;
}
''';
-var input = new SourceFile.text('input.dart', INPUT);
+var input = new SourceFile(INPUT, url: 'input.dart');
/// A span in the input file
-Span ispan(int start, int end, [bool isIdentifier = false]) =>
- new FileSpan(input, start, end, isIdentifier);
+SourceMapSpan ispan(int start, int end, [bool isIdentifier = false]) =>
+ new SourceMapFileSpan(input.span(start, end), isIdentifier: isIdentifier);
-Span inputVar1 = ispan(30, 38, true);
-Span inputFunction = ispan(74, 82, true);
-Span inputVar2 = ispan(87, 95, true);
+SourceMapSpan inputVar1 = ispan(30, 38, true);
+SourceMapSpan inputFunction = ispan(74, 82, true);
+SourceMapSpan inputVar2 = ispan(87, 95, true);
-Span inputVar1NoSymbol = ispan(30, 38);
-Span inputFunctionNoSymbol = ispan(74, 82);
-Span inputVar2NoSymbol = ispan(87, 95);
+SourceMapSpan inputVar1NoSymbol = ispan(30, 38);
+SourceMapSpan inputFunctionNoSymbol = ispan(74, 82);
+SourceMapSpan inputVar2NoSymbol = ispan(87, 95);
-Span inputExpr = ispan(108, 127);
+SourceMapSpan inputExpr = ispan(108, 127);
/// Content of the target file
const String OUTPUT = '''
var x = 3;
f(y) => x + y;
''';
-var output = new SourceFile.text('output.dart', OUTPUT);
+var output = new SourceFile(OUTPUT, url: 'output.dart');
/// A span in the output file
-Span ospan(int start, int end, [bool isIdentifier = false]) =>
- new FileSpan(output, start, end, isIdentifier);
+SourceMapSpan ospan(int start, int end, [bool isIdentifier = false]) =>
+ new SourceMapFileSpan(output.span(start, end), isIdentifier: isIdentifier);
-Span outputVar1 = ospan(4, 5, true);
-Span outputFunction = ospan(11, 12, true);
-Span outputVar2 = ospan(13, 14, true);
-Span outputVar1NoSymbol = ospan(4, 5);
-Span outputFunctionNoSymbol = ospan(11, 12);
-Span outputVar2NoSymbol = ospan(13, 14);
-Span outputExpr = ospan(19, 24);
+SourceMapSpan outputVar1 = ospan(4, 5, true);
+SourceMapSpan outputFunction = ospan(11, 12, true);
+SourceMapSpan outputVar2 = ospan(13, 14, true);
+SourceMapSpan outputVar1NoSymbol = ospan(4, 5);
+SourceMapSpan outputFunctionNoSymbol = ospan(11, 12);
+SourceMapSpan outputVar2NoSymbol = ospan(13, 14);
+SourceMapSpan outputExpr = ospan(19, 24);
/// Expected output mapping when recording the following four mappings:
/// inputVar1 <= outputVar1
@@ -70,7 +71,8 @@ const Map<String, dynamic> EXPECTED_MAP = const {
'file': 'output.dart'
};
-check(Span outputSpan, Mapping mapping, Span inputSpan, bool realOffsets) {
+check(SourceSpan outputSpan, Mapping mapping, SourceMapSpan inputSpan,
+ bool realOffsets) {
var line = outputSpan.start.line;
var column = outputSpan.start.column;
var files = realOffsets ? {'input.dart': input} : null;
« no previous file with comments | « pkg/source_maps/test/builder_test.dart ('k') | pkg/source_maps/test/end2end_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698