Skip to content

fix: title tests #61

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
90 changes: 0 additions & 90 deletions test/description.jl

This file was deleted.

31 changes: 31 additions & 0 deletions test/title.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
function first_line(s::String)
lines = split(s, '\n')
return string(lines[1])
end

function check(expected::Regex, real::String)
if occursin(expected, real)
@test true
else
@test false
@error string(" Expected: ", expected)
@error string("Expression: ", string(real))
end
end

@testset "Title" begin
doc = test_pandoc(
"""Some readme information.""";
description = nothing,
)
expected_pattern = Regex("\\*test.txt\\* +For NVIM v0.8.0 +Last change: " * CURRENT_DATE)
check(expected_pattern, first_line(doc))

doc = test_pandoc(
"""Some readme information.""";
vimversion = "VIM v9.0.0",
description = nothing,
)
expected_pattern = Regex("\\*test.txt\\* +For VIM v9.0.0 +Last change: " * CURRENT_DATE)
check(expected_pattern, first_line(doc))
end