OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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:analyzer/src/dart/element/element.dart'; | 5 import 'package:analyzer/src/dart/element/element.dart'; |
6 import 'package:analyzer/src/summary/format.dart'; | 6 import 'package:analyzer/src/summary/format.dart'; |
7 import 'package:analyzer/src/summary/name_filter.dart'; | 7 import 'package:analyzer/src/summary/name_filter.dart'; |
| 8 import 'package:test/test.dart'; |
8 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 9 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
9 import 'package:unittest/unittest.dart'; | |
10 | 10 |
11 main() { | 11 main() { |
12 groupSep = ' | '; | 12 defineReflectiveSuite(() { |
13 defineReflectiveTests(NameFilterTest); | 13 defineReflectiveTests(NameFilterTest); |
| 14 }); |
14 } | 15 } |
15 | 16 |
16 @reflectiveTest | 17 @reflectiveTest |
17 class NameFilterTest { | 18 class NameFilterTest { |
18 test_accepts_accessors_hide() { | 19 test_accepts_accessors_hide() { |
19 NameFilter filter = new NameFilter.forUnlinkedCombinator( | 20 NameFilter filter = new NameFilter.forUnlinkedCombinator( |
20 new UnlinkedCombinatorBuilder(hides: ['bar'])); | 21 new UnlinkedCombinatorBuilder(hides: ['bar'])); |
21 expect(filter.accepts('foo'), isTrue); | 22 expect(filter.accepts('foo'), isTrue); |
22 expect(filter.accepts('foo='), isTrue); | 23 expect(filter.accepts('foo='), isTrue); |
23 expect(filter.accepts('bar'), isFalse); | 24 expect(filter.accepts('bar'), isFalse); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 .merge(new NameFilter.forUnlinkedCombinator( | 225 .merge(new NameFilter.forUnlinkedCombinator( |
225 new UnlinkedCombinatorBuilder(shows: ['bar']))); | 226 new UnlinkedCombinatorBuilder(shows: ['bar']))); |
226 expect(filter.accepts('foo'), isFalse); | 227 expect(filter.accepts('foo'), isFalse); |
227 expect(filter.accepts('bar'), isFalse); | 228 expect(filter.accepts('bar'), isFalse); |
228 expect(filter.accepts('baz'), isFalse); | 229 expect(filter.accepts('baz'), isFalse); |
229 expect(filter.hiddenNames, isNull); | 230 expect(filter.hiddenNames, isNull); |
230 expect(filter.shownNames, isNotNull); | 231 expect(filter.shownNames, isNotNull); |
231 expect(filter.shownNames, isEmpty); | 232 expect(filter.shownNames, isEmpty); |
232 } | 233 } |
233 } | 234 } |
OLD | NEW |