OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library test.source_maps_test; | |
6 | |
7 import 'dart:convert'; | |
8 import 'package:unittest/unittest.dart'; | |
9 import 'package:source_maps/source_maps.dart'; | |
10 import 'common.dart'; | |
11 | |
12 main() { | |
13 test('builder - with span', () { | |
14 var map = (new SourceMapBuilder() | |
15 ..addSpan(inputVar1, outputVar1) | |
16 ..addSpan(inputFunction, outputFunction) | |
17 ..addSpan(inputVar2, outputVar2) | |
18 ..addSpan(inputExpr, outputExpr)) | |
19 .build(output.url.toString()); | |
20 expect(map, equals(EXPECTED_MAP)); | |
21 }); | |
22 | |
23 test('builder - with location', () { | |
24 var str = (new SourceMapBuilder() | |
25 ..addLocation(inputVar1.start, outputVar1.start, 'longVar1') | |
26 ..addLocation(inputFunction.start, outputFunction.start, 'longName') | |
27 ..addLocation(inputVar2.start, outputVar2.start, 'longVar2') | |
28 ..addLocation(inputExpr.start, outputExpr.start, null)) | |
29 .toJson(output.url.toString()); | |
30 expect(str, JSON.encode(EXPECTED_MAP)); | |
31 }); | |
32 } | |
OLD | NEW |