Weave.jl/test/render/texformats.jl

31 lines
865 B
Julia
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

@testset "unicode to latex conversion" begin
unicode2latex(args...) = Weave.unicode2latex(get_format("md2tex"), args...)
# unit test
let
s = unicode2latex("α = 10")
@test !occursin("α", s)
@test occursin("alpha", s)
end
# end2end
let
str = """
```julia
α = 10
```
"""
doc = mock_run(str; doctype = "md2tex")
Weave.set_format_options!(doc.format)
rendered = Weave.render_doc(doc)
@test occursin("alpha", rendered)
@test !occursin("α", rendered)
doc = mock_run(str; doctype = "md2tex")
Weave.set_format_options!(doc.format; keep_unicode = true)
rendered = Weave.render_doc(doc)
@test !occursin("alpha", rendered)
@test occursin("α", rendered)
end
end # @testset "rendering tex formats"