Fix a Windows test, maybe
This commit is contained in:
parent
358c213b87
commit
4e1247c504
@ -13,7 +13,11 @@ function Base.show(io::IO, ::MIME"text/plain", p::T) where T <: Plugin
|
|||||||
end
|
end
|
||||||
|
|
||||||
show_field(x) = repr(x)
|
show_field(x) = repr(x)
|
||||||
show_field(x::AbstractString) = repr(contractuser(x))
|
if Sys.iswindows()
|
||||||
|
show_field(x::AbstractString) = replace(repr(contractuser(x)), "\\\\" => "\\")
|
||||||
|
else
|
||||||
|
show_field(x::AbstractString) = repr(contractuser(x))
|
||||||
|
end
|
||||||
|
|
||||||
function Base.show(io::IO, m::MIME"text/plain", t::Template)
|
function Base.show(io::IO, m::MIME"text/plain", t::Template)
|
||||||
println(io, "Template:")
|
println(io, "Template:")
|
||||||
|
@ -90,7 +90,7 @@ function Template(::Val{false}; kwargs...)
|
|||||||
plugins = Dict(typeof(p) => p for p in enabled)
|
plugins = Dict(typeof(p) => p for p in enabled)
|
||||||
|
|
||||||
# TODO: It might be nice to offer some kind of warn_incompatible function
|
# TODO: It might be nice to offer some kind of warn_incompatible function
|
||||||
# to be optionally implented by plugins instead of hardcoding this case here.
|
# to be optionally implemented by plugins instead of hardcoding this case here.
|
||||||
julia = getkw(kwargs, :julia_version)
|
julia = getkw(kwargs, :julia_version)
|
||||||
julia < v"1.2" && haskey(plugins, Tests) && plugins[Tests].project && @warn string(
|
julia < v"1.2" && haskey(plugins, Tests) && plugins[Tests].project && @warn string(
|
||||||
"The Tests plugin is set to create a project (supported in Julia 1.2 and later)",
|
"The Tests plugin is set to create a project (supported in Julia 1.2 and later)",
|
||||||
|
@ -5,7 +5,7 @@ const LICENSE_DIR = contractuser(PT.LICENSE_DIR)
|
|||||||
@testset "Plugins" begin
|
@testset "Plugins" begin
|
||||||
expected = """
|
expected = """
|
||||||
Readme:
|
Readme:
|
||||||
file: "$DEFAULTS_DIR/README.md"
|
file: "$(joinpath(DEFAULTS_DIR, "README.md"))"
|
||||||
destination: "README.md"
|
destination: "README.md"
|
||||||
inline_badges: false
|
inline_badges: false
|
||||||
"""
|
"""
|
||||||
@ -29,14 +29,14 @@ const LICENSE_DIR = contractuser(PT.LICENSE_DIR)
|
|||||||
ds_store: true
|
ds_store: true
|
||||||
dev: true
|
dev: true
|
||||||
License:
|
License:
|
||||||
path: "$LICENSE_DIR/MIT"
|
path: "$(joinpath(LICENSE_DIR, "MIT"))"
|
||||||
destination: "LICENSE"
|
destination: "LICENSE"
|
||||||
Readme:
|
Readme:
|
||||||
file: "$DEFAULTS_DIR/README.md"
|
file: "$(joinpath(DEFAULTS_DIR, "README.md"))"
|
||||||
destination: "README.md"
|
destination: "README.md"
|
||||||
inline_badges: false
|
inline_badges: false
|
||||||
Tests:
|
Tests:
|
||||||
file: "$DEFAULTS_DIR/runtests.jl"
|
file: "$(joinpath(DEFAULTS_DIR, "runtests.jl"))"
|
||||||
project: false
|
project: false
|
||||||
"""
|
"""
|
||||||
@test sprint(show, MIME("text/plain"), tpl(; authors=USER)) == rstrip(expected)
|
@test sprint(show, MIME("text/plain"), tpl(; authors=USER)) == rstrip(expected)
|
||||||
|
Loading…
Reference in New Issue
Block a user