Skip to content

Commit

Permalink
coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
wookay committed Aug 24, 2015
1 parent 8047ded commit c5f243b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/PageDown.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ end
function open(page::Page, site::Int)
counter = 0
for slide in page |> proper |> slides
for content in slide.content
isa(slide, Base.Markdown.MD) && for content in slide.content
isa(content, Base.Markdown.List) && for item in content.items
for el in item
m = match(r"http.*", el)
Expand Down Expand Up @@ -155,12 +155,10 @@ macro open(site::Int)
:( open($(esc(:page)),$site) )
end

function Base.Markdown.term(t::Base.Pipe, a::Array{Base.Markdown.MD,1})
[Base.Markdown.term(t, e) for e in a]
end

function Base.Markdown.term(t::Base.TTY, a::Array{Base.Markdown.MD,1})
# term
Base.Markdown.term(t::Union{Base.Pipe,Base.TTY}, a::Array{Base.Markdown.MD,1}) =
[Base.Markdown.term(t, e) for e in a]
end
Base.Markdown.term(t::Base.TTY, a::Array{ASCIIString,1}) = a

end # module
8 changes: 8 additions & 0 deletions test/page.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,12 @@ first!(page)

@test (page,["1"]) == proper(page)


# coverage
page = Page(1, 10, pages, Dict())
@test_throws ArgumentError go!(page, 10)
last!(page)
@open 1
Base.Markdown.term(STDOUT, @first)

end

0 comments on commit c5f243b

Please sign in to comment.