OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 directive_parser_test; | 5 library directive_parser_test; |
6 | 6 |
7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
8 import 'package:unittest/vm_config.dart'; | 8 import 'package:unittest/vm_config.dart'; |
9 import 'package:web_components/src/info.dart' show DartCodeInfo; | 9 import 'package:web_ui/src/info.dart' show DartCodeInfo; |
10 import 'package:web_components/src/messages.dart' show messages; | 10 import 'package:web_ui/src/messages.dart' show messages; |
11 import 'package:web_components/src/directive_parser.dart'; | 11 import 'package:web_ui/src/directive_parser.dart'; |
12 import 'testing.dart'; | 12 import 'testing.dart'; |
13 | 13 |
14 main() { | 14 main() { |
15 useVmConfiguration(); | 15 useVmConfiguration(); |
16 useMockMessages(); | 16 useMockMessages(); |
17 | 17 |
18 test('empty contents', () { | 18 test('empty contents', () { |
19 var info = _parse(''); | 19 var info = _parse(''); |
20 expect(info, isNotNull); | 20 expect(info, isNotNull); |
21 expect(info.libraryName, isNull); | 21 expect(info.libraryName, isNull); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 expect(info.directives[1].label, equals('export')); | 155 expect(info.directives[1].label, equals('export')); |
156 expect(info.directives[1].uri, equals('a2.dart')); | 156 expect(info.directives[1].uri, equals('a2.dart')); |
157 expect(info.directives[1].prefix, isNull); | 157 expect(info.directives[1].prefix, isNull); |
158 expect(info.directives[1].hide, equals(['d', 'e'])); | 158 expect(info.directives[1].hide, equals(['d', 'e'])); |
159 expect(info.directives[1].show, equals(['a', 'b', 'c'])); | 159 expect(info.directives[1].show, equals(['a', 'b', 'c'])); |
160 expect(info.code, equals('code();\n')); | 160 expect(info.code, equals('code();\n')); |
161 }); | 161 }); |
162 } | 162 } |
163 | 163 |
164 _parse(String code) => parseDartCode(code, null, messages); | 164 _parse(String code) => parseDartCode(code, null, messages); |
OLD | NEW |