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 import 'package:unittest/unittest.dart'; | 5 import 'package:unittest/unittest.dart'; |
6 | 6 |
7 import 'package:analyzer_experimental/src/generated/java_core.dart' show CharSeq
uence; | 7 import 'package:analyzer/src/generated/java_core.dart' show CharSequence; |
8 import 'package:analyzer_experimental/src/generated/scanner.dart'; | 8 import 'package:analyzer/src/generated/scanner.dart'; |
9 import 'package:analyzer_experimental/src/services/formatter_impl.dart'; | 9 import 'package:analyzer/src/services/formatter_impl.dart'; |
10 import 'package:analyzer_experimental/src/services/writer.dart'; | 10 import 'package:analyzer/src/services/writer.dart'; |
11 | 11 |
12 main() { | 12 main() { |
13 | 13 |
14 /// Formatter tests | 14 /// Formatter tests |
15 group('formatter', () { | 15 group('formatter', () { |
16 | 16 |
17 test('failed parse', () { | 17 test('failed parse', () { |
18 var formatter = new CodeFormatter(); | 18 var formatter = new CodeFormatter(); |
19 expect(() => formatter.format(CodeKind.COMPILATION_UNIT, '~'), | 19 expect(() => formatter.format(CodeKind.COMPILATION_UNIT, '~'), |
20 throwsA(new isInstanceOf<FormatterException>())); | 20 throwsA(new isInstanceOf<FormatterException>())); |
(...skipping 1046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1067 expect(() => new TokenStreamComparator(null, t1, t2).verifyEquals(), | 1067 expect(() => new TokenStreamComparator(null, t1, t2).verifyEquals(), |
1068 throwsA(new isInstanceOf<FormatterException>())); | 1068 throwsA(new isInstanceOf<FormatterException>())); |
1069 | 1069 |
1070 expectCUFormatsTo(src, expected, {transforms: true}) => | 1070 expectCUFormatsTo(src, expected, {transforms: true}) => |
1071 expect(formatCU(src, options: new FormatterOptions( | 1071 expect(formatCU(src, options: new FormatterOptions( |
1072 codeTransforms: transforms)).source, equals(expected)); | 1072 codeTransforms: transforms)).source, equals(expected)); |
1073 | 1073 |
1074 expectStmtFormatsTo(src, expected, {transforms: true}) => | 1074 expectStmtFormatsTo(src, expected, {transforms: true}) => |
1075 expect(formatStatement(src, options: | 1075 expect(formatStatement(src, options: |
1076 new FormatterOptions(codeTransforms: transforms)), equals(expected)); | 1076 new FormatterOptions(codeTransforms: transforms)), equals(expected)); |
OLD | NEW |