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

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

Issue 23596007: Remove usage of dart:json. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebase. Created 7 years, 3 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
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.source_maps_test; 5 library test.source_maps_test;
6 6
7 import 'dart:json' as json; 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';
11 11
12 main() { 12 main() {
13 test('builder - with span', () { 13 test('builder - with span', () {
14 var map = (new SourceMapBuilder() 14 var map = (new SourceMapBuilder()
15 ..addSpan(inputVar1, outputVar1) 15 ..addSpan(inputVar1, outputVar1)
16 ..addSpan(inputFunction, outputFunction) 16 ..addSpan(inputFunction, outputFunction)
17 ..addSpan(inputVar2, outputVar2) 17 ..addSpan(inputVar2, outputVar2)
18 ..addSpan(inputExpr, outputExpr)) 18 ..addSpan(inputExpr, outputExpr))
19 .build(output.url); 19 .build(output.url);
20 expect(map, equals(EXPECTED_MAP)); 20 expect(map, equals(EXPECTED_MAP));
21 }); 21 });
22 22
23 test('builder - with location', () { 23 test('builder - with location', () {
24 var str = (new SourceMapBuilder() 24 var str = (new SourceMapBuilder()
25 ..addLocation(inputVar1.start, outputVar1.start, 'longVar1') 25 ..addLocation(inputVar1.start, outputVar1.start, 'longVar1')
26 ..addLocation(inputFunction.start, outputFunction.start, 'longName') 26 ..addLocation(inputFunction.start, outputFunction.start, 'longName')
27 ..addLocation(inputVar2.start, outputVar2.start, 'longVar2') 27 ..addLocation(inputVar2.start, outputVar2.start, 'longVar2')
28 ..addLocation(inputExpr.start, outputExpr.start, null)) 28 ..addLocation(inputExpr.start, outputExpr.start, null))
29 .toJson(output.url); 29 .toJson(output.url);
30 expect(str, json.stringify(EXPECTED_MAP)); 30 expect(str, JSON.encode(EXPECTED_MAP));
31 }); 31 });
32 } 32 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698