tests: add more tests
parent
34a9a1a017
commit
0e93698305
16
test/URIs.jl
16
test/URIs.jl
|
@ -1,4 +1,5 @@
|
||||||
using Test
|
using Test
|
||||||
|
|
||||||
unescape_expected = [
|
unescape_expected = [
|
||||||
"String without percent" => "String without percent",
|
"String without percent" => "String without percent",
|
||||||
"String%20with%20spaces" => "String with spaces",
|
"String%20with%20spaces" => "String with spaces",
|
||||||
|
@ -58,3 +59,18 @@ end
|
||||||
("gemini", "hostname", 1965, ["a", "b", "c"], "percent encoding"))
|
("gemini", "hostname", 1965, ["a", "b", "c"], "percent encoding"))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@testset "Request to string" begin
|
||||||
|
@test string(Request("gemini://host")) == "host"
|
||||||
|
@test string(Request("https://host")) == "https://host"
|
||||||
|
@test string(Request("host:1965")) == "host"
|
||||||
|
@test string(Request("host:1965/")) == "host"
|
||||||
|
@test string(Request("gemini://host:1965/")) == "host"
|
||||||
|
@test string(Request("host/a/b")) == "host/a/b"
|
||||||
|
@test string(Request("https://host/a/b")) == "https://host/a/b"
|
||||||
|
@test string(Request("https://host:1965/a/b?test")) == "https://host/a/b?test"
|
||||||
|
end
|
||||||
|
|
||||||
|
@testset "Requests format enforced" begin
|
||||||
|
@test_throws OverflowError Gemenon.get(Request("a" ^ 1025))
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue