OLD | NEW |
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.end2end_test; | 5 library test.end2end_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'package:source_maps/source_maps.dart'; | 8 import 'package:source_maps/source_maps.dart'; |
9 import 'common.dart'; | 9 import 'common.dart'; |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 .toJson(output.url); | 44 .toJson(output.url); |
45 var mapping = parse(json); | 45 var mapping = parse(json); |
46 check(outputVar1, mapping, inputVar1, true); | 46 check(outputVar1, mapping, inputVar1, true); |
47 check(outputVar2, mapping, inputVar2, true); | 47 check(outputVar2, mapping, inputVar2, true); |
48 check(outputFunction, mapping, inputFunction, true); | 48 check(outputFunction, mapping, inputFunction, true); |
49 check(outputExpr, mapping, inputExpr, true); | 49 check(outputExpr, mapping, inputExpr, true); |
50 }); | 50 }); |
51 | 51 |
52 test('printer projecting marks + parse', () { | 52 test('printer projecting marks + parse', () { |
53 var out = INPUT.replaceAll('long', '_s'); | 53 var out = INPUT.replaceAll('long', '_s'); |
54 var file = new File.text('output2.dart', out); | 54 var file = new SourceFile.text('output2.dart', out); |
55 var printer = new Printer('output2.dart'); | 55 var printer = new Printer('output2.dart'); |
56 printer.mark(ispan(0, 0)); | 56 printer.mark(ispan(0, 0)); |
57 | 57 |
58 bool first = true; | 58 bool first = true; |
59 var segments = INPUT.split('long'); | 59 var segments = INPUT.split('long'); |
60 expect(segments.length, 6); | 60 expect(segments.length, 6); |
61 printer.add(segments[0], projectMarks: true); | 61 printer.add(segments[0], projectMarks: true); |
62 printer.mark(inputVar1); | 62 printer.mark(inputVar1); |
63 printer.add('_s'); | 63 printer.add('_s'); |
64 printer.add(segments[1], projectMarks: true); | 64 printer.add(segments[1], projectMarks: true); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 | 97 |
98 // Start of the last line | 98 // Start of the last line |
99 var oOffset = out.length - 2; | 99 var oOffset = out.length - 2; |
100 var iOffset = INPUT.length - 2; | 100 var iOffset = INPUT.length - 2; |
101 check(new FileSpan(file, oOffset, oOffset, false), mapping, | 101 check(new FileSpan(file, oOffset, oOffset, false), mapping, |
102 ispan(iOffset, iOffset), true); | 102 ispan(iOffset, iOffset), true); |
103 check(new FileSpan(file, oOffset + 1, oOffset + 1, false), mapping, | 103 check(new FileSpan(file, oOffset + 1, oOffset + 1, false), mapping, |
104 ispan(iOffset, iOffset), true); | 104 ispan(iOffset, iOffset), true); |
105 }); | 105 }); |
106 } | 106 } |
OLD | NEW |