Add a test for the test/Project.toml warning
This commit is contained in:
parent
ca51806cf6
commit
69a7c5c68b
@ -29,7 +29,7 @@ function validate(p::Tests, t::Template)
|
||||
invoke(validate, Tuple{BasicPlugin, Template}, p, t)
|
||||
p.project && t.julia < v"1.2" && @warn string(
|
||||
"Tests: The project option is set to create a project (supported in Julia 1.2 and later) ",
|
||||
"but a Julia version older than 1.2 is supported by the Template",
|
||||
"but a Julia version older than 1.2 ($(t.julia)) is supported by the template",
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -26,4 +26,12 @@ PT.user_view(::BasicTest, ::Template, ::AbstractString) = Dict("X" => 1, "Z" =>
|
||||
@test read(joinpath(pkg_dir, "foo.txt"), String) == s
|
||||
end
|
||||
end
|
||||
|
||||
@testset "Tests Project.toml warning on Julia < 1.2" begin
|
||||
p = Tests(; project=true)
|
||||
@test_logs (:warn, r"The project option is set") tpl(; julia=v"1", plugins=[p])
|
||||
@test_logs (:warn, r"The project option is set") tpl(; julia=v"1.1", plugins=[p])
|
||||
@test_logs tpl(; julia=v"1.2", plugins=[p])
|
||||
@test_logs tpl(; julia=v"1.3", plugins=[p])
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user