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

Add test for "corporate authors" #47

Merged
merged 3 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
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
26 changes: 26 additions & 0 deletions test/test_formatting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,29 @@ end
@Test md("jax") ==
"Bradbury, J.; Frostig, R.; Hawkins, P.; Johnson, M. J.; Leary, C.; Maclaurin, D.; Necula, G.; Paszke, A.; VanderPlas, J.; Wanderman-Milne, S. and Zhang, Q. [*`JAX`: composable transformations of Python+NumPy programs*](https://github.com/google/jax), [`https://numpy.org`](https://numpy.org)."
end


@testset "corporate author" begin

# https://github.com/JuliaDocs/DocumenterCitations.jl/issues/44

bib = CitationBibliography(joinpath(splitext(@__FILE__)[1], "corporateauthor.bib"))

entry = bib.entries["OEIS"]

name = entry.authors[1]
@test name.last == "{OEIS Foundation Inc.}"
@test name.first == ""
@test name.middle == ""
@test name.particle == ""

md(key) = format_bibliography_reference(Val(:numeric), bib.entries[key])
@test md("OEIS") ==
"OEIS Foundation Inc. [*The On-Line Encyclopedia of Integer Sequences*](https://oeis.org). Published electronically at https://oeis.org (2023)."

nbsp = "\u00A0"
@test md("OEISworkaround") ==
"OEIS$(nbsp)Foundation$(nbsp)Inc. [*The On-Line Encyclopedia of Integer Sequences*](https://oeis.org). Published electronically at https://oeis.org (2023)."


end
15 changes: 15 additions & 0 deletions test/test_formatting/corporateauthor.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@Misc{OEIS,
author = {{OEIS Foundation Inc.}},
title = {The {O}n-{L}ine {E}ncyclopedia of {I}nteger {S}equences},
howpublished = {Published electronically at https://oeis.org},
year = {2023},
url = {https://oeis.org}
}

@Misc{OEISworkaround,
author = {OEIS Foundation Inc.},
title = {The {O}n-{L}ine {E}ncyclopedia of {I}nteger {S}equences},
howpublished = {Published electronically at https://oeis.org},
year = {2023},
url = {https://oeis.org}
}