Skip to content

Commit

Permalink
test: add html renderer encoding test #687 (#691)
Browse files Browse the repository at this point in the history
  • Loading branch information
noxthot authored Feb 19, 2024
1 parent 4b33353 commit 9abaae8
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion test/tests_html_rendering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,21 @@

rm("build", force = true, recursive = true)
end;

@testset "Encoding Test" begin
using Genie.Renderer, Genie.Renderer.Html

path = mktempdir(cleanup=true)
fpath = joinpath(path, "welcome.jl.html")

write(fpath, "welcöme. 不一定要味道好,但一定要有用. äüö&%?#")

expected = "HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=utf-8\r\n\r\n<!DOCTYPE html><html>\n <body>\n <p>welcöme. 不一定要味道好,但一定要有用. äüö&%?#\n</p>\n </body></html>"

decoded = String(html(filepath(fpath)))

@test decoded == expected
end

end;
end
end

0 comments on commit 9abaae8

Please sign in to comment.