From 0e93698305dfc99ff4e8e814b157ae4059d65a66 Mon Sep 17 00:00:00 2001 From: nixo Date: Sun, 25 Oct 2020 10:45:26 +0100 Subject: [PATCH] tests: add more tests --- test/URIs.jl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/URIs.jl b/test/URIs.jl index 21be6c7..664d253 100644 --- a/test/URIs.jl +++ b/test/URIs.jl @@ -1,4 +1,5 @@ using Test + unescape_expected = [ "String without percent" => "String without percent", "String%20with%20spaces" => "String with spaces", @@ -58,3 +59,18 @@ end ("gemini", "hostname", 1965, ["a", "b", "c"], "percent encoding")) 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