-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a way for users to tell Documenter about unexported names that ar…
…e part of their package's public API
- Loading branch information
1 parent
eea5e5c
commit 983391f
Showing
4 changed files
with
93 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using Documenter | ||
using Test | ||
|
||
module TestingNonExportedPublicNames | ||
|
||
export f | ||
|
||
const NONEXPORTED_PUBLIC_NAMES = Symbol[:g] | ||
|
||
""" | ||
f is exported, and it is part of the public API | ||
""" | ||
function f end | ||
|
||
""" | ||
g is not exported, but it is part of the public API | ||
""" | ||
function g end | ||
|
||
""" | ||
h is not exported, and it is private (internal) | ||
""" | ||
function h end | ||
|
||
end # end module TestingNonExportedPublicNames | ||
|
||
@test Documenter.Expanders.name_is_public(TestingNonExportedPublicNames, :f) | ||
@test Documenter.Expanders.name_is_public(TestingNonExportedPublicNames, :g) | ||
@test !Documenter.Expanders.name_is_public(TestingNonExportedPublicNames, :h) | ||
|
||
@test Base.isexported(TestingNonExportedPublicNames, :f) | ||
@test !Base.isexported(TestingNonExportedPublicNames, :g) | ||
@test !Base.isexported(TestingNonExportedPublicNames, :h) | ||
|
||
@test !Documenter.Expanders._name_is_public_but_nonexported(TestingNonExportedPublicNames, :f) | ||
@test Documenter.Expanders._name_is_public_but_nonexported(TestingNonExportedPublicNames, :g) | ||
@test !Documenter.Expanders._name_is_public_but_nonexported(TestingNonExportedPublicNames, :h) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters