Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable some doctests #1413

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/PrintHelper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ obtain the correct pluralization. But it works well enough in the
vast majority of cases.

# Examples
```julia
```jldoctest; setup = :(using AbstractAlgebra)
julia> pluralize("generator")
generators
"generators"

julia> pluralize("variety")
varieties
"varieties"
```
"""
function pluralize(noun::String)
Expand Down Expand Up @@ -67,7 +67,7 @@ have. Ideally, though, please instead improve `pluralize` to handle your needs
correctly.

# Examples
```julia
```jldoctest; setup = :(using AbstractAlgebra)
julia> ItemQuantity(0, "generator")
0 generators

Expand All @@ -79,7 +79,7 @@ julia> ItemQuantity(2, "generator")
```

Here is an example with a custom plural form.
```julia
```jldoctest; setup = :(using AbstractAlgebra)
julia> ItemQuantity(0, "ox", "oxen")
0 oxen

Expand Down Expand Up @@ -116,7 +116,7 @@ end
A helper function which returns `number` as a string in ordinal form.

# Examples
```julia
```jldoctest; setup = :(using AbstractAlgebra; ordinal_number_string=AbstractAlgebra.ordinal_number_string)
julia> ordinal_number_string(1)
"1st"

Expand Down
Loading