Skip to content

Commit 13f5964

Browse files
committed
Only hide @internal
1 parent ec49748 commit 13f5964

File tree

3 files changed

+1
-45
lines changed

3 files changed

+1
-45
lines changed

lib/src/model/model_element.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -432,9 +432,6 @@ abstract class ModelElement
432432
if (element.isInternal) {
433433
return false;
434434
}
435-
if (element.isVisibleForTesting) {
436-
return false;
437-
}
438435
return !element.hasPrivateName && !hasNodoc;
439436
}();
440437

test/end2end/model_test.dart

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3830,35 +3830,6 @@ String? topLevelFunction(int param1, bool param2, Cool coolBeans,
38303830
isTrue);
38313831
});
38323832

3833-
test('@visibleForTesting annotation hides element from docs', () {
3834-
expect(exLibrary.functions.named('testingMethod').isPublic, false);
3835-
3836-
expect(
3837-
exLibrary.classes
3838-
.named('Apple')
3839-
.allFields
3840-
.named('testField')
3841-
.isPublic,
3842-
isFalse);
3843-
3844-
expect(
3845-
exLibrary.classes
3846-
.named('Apple')
3847-
.instanceMethods
3848-
.named('testMethod')
3849-
.isPublic,
3850-
isFalse);
3851-
3852-
// The overridden method is not internal, and thus exposed.
3853-
expect(
3854-
exLibrary.classes
3855-
.named('B')
3856-
.instanceMethods
3857-
.named('testMethod')
3858-
.isPublic,
3859-
isTrue);
3860-
});
3861-
38623833
test('type arguments are correct', () {
38633834
var modelType = mapWithDynamicKeys.modelType as ParameterizedElementType;
38643835
expect(modelType.typeArguments, hasLength(2));

testing/test_package/lib/example.dart

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import 'package:test_package_imported/main.dart';
1313

1414
export 'package:args/args.dart' show ArgParser;
1515
export 'dart:core' show deprecated, Deprecated;
16-
import 'package:meta/meta.dart' show protected, factory, internal, visibleForTesting;
16+
import 'package:meta/meta.dart' show protected, factory, internal;
1717

1818
export 'fake.dart' show Cool, ClassTemplateOneLiner;
1919
export 'src/mylib.dart' show Helper;
@@ -34,10 +34,6 @@ const DO_NOT_DOCUMENT = 'not documented';
3434
@internal
3535
final topLevelInternal = 'not documented';
3636

37-
/// top level testing function
38-
@visibleForTesting
39-
String testingMethod() => 'not documented';
40-
4137
/// This is the same name as a top-level const from the fake lib.
4238
const incorrectDocReference = 'same name as const from fake';
4339

@@ -134,10 +130,6 @@ class Apple {
134130
/// No public docs for this
135131
@internal
136132
int? internalField;
137-
138-
/// No public docs for this
139-
@visibleForTesting
140-
int? testField;
141133

142134
///Constructor
143135
Apple();
@@ -184,10 +176,6 @@ class Apple {
184176
/// No public docs for this
185177
@internal
186178
void internalMethod() {}
187-
188-
/// No public docs for this
189-
@visibleForTesting
190-
void testMethod() {}
191179

192180
void paramFromExportLib(Helper helper) {}
193181

0 commit comments

Comments
 (0)