From 1a8fad9cb5224ac9c511c8950abfe286da734d56 Mon Sep 17 00:00:00 2001 From: Brandon Taylor Date: Wed, 2 Aug 2017 22:21:58 -0400 Subject: [PATCH] Revert "move some tests into doctests" This reverts commit 54da038df96bce0e596b67115a926e76ee68feb8. --- src/bibliography.jl | 40 ---------------------------------------- test/runtests.jl | 6 ++++++ 2 files changed, 6 insertions(+), 40 deletions(-) diff --git a/src/bibliography.jl b/src/bibliography.jl index 68a41cc..8d727dc 100644 --- a/src/bibliography.jl +++ b/src/bibliography.jl @@ -11,46 +11,6 @@ Given a string (or IO stream) of bibtex-format bibliography data, parses the data and returns a `Dict`-like object `b::Bibliography` that behaves as a dictionary mapping strings to bibliography items [`Citation`](@ref). - -```jldoctest -julia> using BibTeX - -julia> b = open(Bibliography, joinpath((@__FILE__) |> dirname |> dirname, "example", "examples.bib"), "r") -BibTeX.Bibliography with 92 entries: - "coleridge" => Citation{:book}(16 entries) - "wilde" => Citation{:book}(8 entries) - "aristotle:physics" => Citation{:book}(11 entries) - "markey" => Citation{:online}(11 entries) - "wassenberg" => Citation{:online}(11 entries) - "baez/online" => Citation{:online}(9 entries) - "moore:related" => Citation{:article}(12 entries) - "almendro" => Citation{:patent}(7 entries) - "sigfridsson" => Citation{:article}(13 entries) - "malinowski" => Citation{:book}(11 entries) - "nietzsche:ksa" => Citation{:book}(14 entries) - "vangennep" => Citation{:book}(11 entries) - "yoon" => Citation{:article}(8 entries) - "gaonkar:in" => Citation{:incollection}(9 entries) - "cms" => Citation{:manual}(14 entries) - "moore" => Citation{:article}(9 entries) - "laufenberg" => Citation{:patent}(10 entries) - "iliad" => Citation{:book}(13 entries) - "baez/article" => Citation{:article}(12 entries) - ⋮ => ⋮ - -julia> b["angenendt"] -BibTeX.Citation{:article} with 10 entries: - "pages" => "431--456, 791--823" - "shorttitle" => "In Honore Salvatoris" - "author" => "Angenendt, Arnold" - "langid" => "german" - "date" => "2002" - "annotation" => "A German article in a French journal. Apart from that, a t… - "indextitle" => "In Honore Salvatoris" - "volume" => "97" - "journaltitle" => "Revue d'Histoire Eccl{\\\\'e}siastique" - "title" => "In Honore Salvatoris~-- Vom Sinn und Unsinn der Patrozinie… -``` """ function Bibliography(bibtex::String) preamble, data = parse_bibtex(bibtex) diff --git a/test/runtests.jl b/test/runtests.jl index ce3e9b2..0831462 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -13,6 +13,12 @@ Documenter.makedocs( authors = "Brandon Taylor" ) +@testset "examples.bib" begin + b = open(Bibliography, joinpath("..", "example", "examples.bib"), "r") + @test length(b) == 92 + @test (b["angenendt"]::Citation{:article})["date"] == "2002" +end + @testset "small bib" begin b = Bibliography(""" @article{foo, bar=baz}