Skip to content

Commit

Permalink
Added sorting key :y for issue #36.
Browse files Browse the repository at this point in the history
  • Loading branch information
LazyScholar authored and Azzaare committed Jul 21, 2021
1 parent 8ca6081 commit c7546ea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/sort_bibliography.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
const sorting_rules = Dict{Symbol, Vector{Symbol}}(
:nty => [:authors;:editors;:title;:date],
:nyt => [:authors;:editors;:date;:title]
:nyt => [:authors;:editors;:date;:title],
:y => [:date]
);
Implemented sorting rules for bibliography entry sorting.
Expand All @@ -10,7 +11,8 @@ See also [`sort_bibliography!`](@ref).
"""
const sorting_rules = Dict{Symbol, Vector{Symbol}}(
:nty => [:authors;:editors;:title;:date],
:nyt => [:authors;:editors;:date;:title]
:nyt => [:authors;:editors;:date;:title],
:y => [:date]
)

"""
Expand Down
17 changes: 16 additions & 1 deletion test/sort_bibliography.jl
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ result = ["2007JJbAbe"
@test testbib.keys == result
end


result = ["2007JJbAbe"
"2007JJaAbe"
"2018DJaMae"
Expand All @@ -69,4 +68,20 @@ result = ["2007JJbAbe"
@test testbib.keys == result
end

result = ["2007JJbAbe"
"2007JJaAbe"
"2018DJaMae"
"2018DJaMad"
"2011JJBcAaa"
"2010JJBaAaa"
"2010JJBbAaa"
"SaA3a2010"
"1998BBaA1a"
"1998BBbA2a"
]
@testset "sort_bibliography! : Ordering: :y" begin
sort_bibliography!( testbib , :nty )
@test testbib.keys == result
end

end # module test_sort_bibliography

0 comments on commit c7546ea

Please sign in to comment.