| 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/summary/format.dart'; | 5 import 'package:analyzer/src/summary/format.dart'; |
| 6 import 'package:analyzer/src/summary/prelink.dart'; | 6 import 'package:analyzer/src/summary/prelink.dart'; |
| 7 import 'package:unittest/unittest.dart'; | 7 import 'package:unittest/unittest.dart'; |
| 8 | 8 |
| 9 import '../../reflective_tests.dart'; | 9 import '../../reflective_tests.dart'; |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 @override | 26 @override |
| 27 Map<String, Object> toMap() { | 27 Map<String, Object> toMap() { |
| 28 fail('toMap() called unexpectedly'); | 28 fail('toMap() called unexpectedly'); |
| 29 return null; | 29 return null; |
| 30 } | 30 } |
| 31 } | 31 } |
| 32 | 32 |
| 33 @reflectiveTest | 33 @reflectiveTest |
| 34 class NameFilterTest { | 34 class NameFilterTest { |
| 35 test_accepts_accessors_hide() { |
| 36 NameFilter filter = new NameFilter.forCombinator( |
| 37 new MockUnlinkedCombinator(hides: ['bar'])); |
| 38 expect(filter.accepts('foo'), isTrue); |
| 39 expect(filter.accepts('foo='), isTrue); |
| 40 expect(filter.accepts('bar'), isFalse); |
| 41 expect(filter.accepts('bar='), isFalse); |
| 42 } |
| 43 |
| 44 test_accepts_accessors_show() { |
| 45 NameFilter filter = new NameFilter.forCombinator( |
| 46 new MockUnlinkedCombinator(shows: ['foo'])); |
| 47 expect(filter.accepts('foo'), isTrue); |
| 48 expect(filter.accepts('foo='), isTrue); |
| 49 expect(filter.accepts('bar'), isFalse); |
| 50 expect(filter.accepts('bar='), isFalse); |
| 51 } |
| 52 |
| 35 test_forCombinator_hide() { | 53 test_forCombinator_hide() { |
| 36 NameFilter filter = new NameFilter.forCombinator( | 54 NameFilter filter = new NameFilter.forCombinator( |
| 37 new MockUnlinkedCombinator(hides: ['foo', 'bar'])); | 55 new MockUnlinkedCombinator(hides: ['foo', 'bar'])); |
| 38 expect(filter.accepts('foo'), isFalse); | 56 expect(filter.accepts('foo'), isFalse); |
| 39 expect(filter.accepts('bar'), isFalse); | 57 expect(filter.accepts('bar'), isFalse); |
| 40 expect(filter.accepts('baz'), isTrue); | 58 expect(filter.accepts('baz'), isTrue); |
| 41 expect(filter.shownNames, isNull); | 59 expect(filter.shownNames, isNull); |
| 42 expect(filter.hiddenNames, isNotNull); | 60 expect(filter.hiddenNames, isNotNull); |
| 43 expect(filter.hiddenNames, ['foo', 'bar'].toSet()); | 61 expect(filter.hiddenNames, ['foo', 'bar'].toSet()); |
| 44 } | 62 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 .merge(new NameFilter.forCombinator( | 204 .merge(new NameFilter.forCombinator( |
| 187 new MockUnlinkedCombinator(shows: ['bar']))); | 205 new MockUnlinkedCombinator(shows: ['bar']))); |
| 188 expect(filter.accepts('foo'), isFalse); | 206 expect(filter.accepts('foo'), isFalse); |
| 189 expect(filter.accepts('bar'), isFalse); | 207 expect(filter.accepts('bar'), isFalse); |
| 190 expect(filter.accepts('baz'), isFalse); | 208 expect(filter.accepts('baz'), isFalse); |
| 191 expect(filter.hiddenNames, isNull); | 209 expect(filter.hiddenNames, isNull); |
| 192 expect(filter.shownNames, isNotNull); | 210 expect(filter.shownNames, isNotNull); |
| 193 expect(filter.shownNames, isEmpty); | 211 expect(filter.shownNames, isEmpty); |
| 194 } | 212 } |
| 195 } | 213 } |
| OLD | NEW |