Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Side by Side Diff: pkg/analyzer/test/src/summary/prelink_test.dart

Issue 1576173002: Handle setters properly in NameFilter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/prelink.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/prelink.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698