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.printer_test; | 5 library test.printer_test; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 import 'package:unittest/unittest.dart'; | 8 import 'package:test/test.dart'; |
9 import 'package:source_maps/source_maps.dart'; | 9 import 'package:source_maps/source_maps.dart'; |
10 import 'package:source_span/source_span.dart'; | 10 import 'package:source_span/source_span.dart'; |
11 import 'common.dart'; | 11 import 'common.dart'; |
12 | 12 |
13 main() { | 13 main() { |
14 test('printer', () { | 14 test('printer', () { |
15 var printer = new Printer('output.dart'); | 15 var printer = new Printer('output.dart'); |
16 printer..add('var ') | 16 printer..add('var ') |
17 ..mark(inputVar1) | 17 ..mark(inputVar1) |
18 ..add('x = 3;\n') | 18 ..add('x = 3;\n') |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 for (int i = 0; i < lines.length; i++) { | 112 for (int i = 0; i < lines.length; i++) { |
113 if (i == 5) printer.indent++; | 113 if (i == 5) printer.indent++; |
114 printer.addLine(lines[i].replaceAll('long', '_s').trim()); | 114 printer.addLine(lines[i].replaceAll('long', '_s').trim()); |
115 if (i == 5) printer.indent--; | 115 if (i == 5) printer.indent--; |
116 } | 116 } |
117 printer.build('output.dart'); | 117 printer.build('output.dart'); |
118 expect(printer.text, out); | 118 expect(printer.text, out); |
119 }); | 119 }); |
120 }); | 120 }); |
121 } | 121 } |
OLD | NEW |