UrlRoundTripTest
`Url.percentDecode` undoes `Url.percentEncode`, giving back `Just` the original string. The two strings round-tripped contain a space and the URL delimiters `/ ? = &`.
Results
elm-0.19.1
passran in 42 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. roundtrip1: Just "hello world" roundtrip2: Just "a/b?c=d&e=f"
elm-0.19.2
passran in 32 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. roundtrip1: Just "hello world" roundtrip2: Just "a/b?c=d&e=f"
elm-0.19.3
passran in 29 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. roundtrip1: Just "hello world" roundtrip2: Just "a/b?c=d&e=f"
lamdera-1.5.0
passran in 41 msOutput
roundtrip1: Just "hello world" roundtrip2: Just "a/b?c=d&e=f"
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-url/UrlRoundTripTest] in its title.
Source
The -- CHECK: lines give the expected output.
module UrlRoundTripTest exposing (main)
{-| `Url.percentDecode` undoes `Url.percentEncode`, giving back `Just` the original string.
The two strings round-tripped contain a space and the URL delimiters
`/ ? = &`.
-}
-- CHECK: roundtrip1: Just "hello world"
-- CHECK: roundtrip2: Just "a/b?c=d&e=f"
import Html exposing (text)
import Url
main =
let
_ = Debug.log "roundtrip1" (Url.percentDecode (Url.percentEncode "hello world"))
_ = Debug.log "roundtrip2" (Url.percentDecode (Url.percentEncode "a/b?c=d&e=f"))
in
text "done"