UrlPercentDecodeTest
`Url.percentDecode` turns `%XX` escapes back into the characters they stand for. `%20`, `%26` and `%3D` decode to a space, `&` and `=`. A `+` is left as a literal `+`, not read as a space.
Results
elm-0.19.1
passran in 59 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.1/optimize for better performance and smaller assets. decode1: Just "hello world" decode2: Just "a&b=c" decode3: Just "a+b"
elm-0.19.2
passran in 64 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.2/optimize for better performance and smaller assets. decode1: Just "hello world" decode2: Just "a&b=c" decode3: Just "a+b"
elm-0.19.3
passran in 48 msOutput
Compiled in DEV mode. Follow the advice at https://elm-lang.org/0.19.3/optimize for better performance and smaller assets. decode1: Just "hello world" decode2: Just "a&b=c" decode3: Just "a+b"
lamdera-1.5.0
passran in 37 msOutput
decode1: Just "hello world" decode2: Just "a&b=c" decode3: Just "a+b"
Discussions
Discuss this test·Search the discussions on GitHub
Discussions are on GitHub; one about this test has [t:elm-url/UrlPercentDecodeTest] in its title.
Source
The -- CHECK: lines give the expected output.
module UrlPercentDecodeTest exposing (main)
{-| `Url.percentDecode` turns `%XX` escapes back into the characters they stand for.
`%20`, `%26` and `%3D` decode to a space, `&` and `=`. A `+` is left as a
literal `+`, not read as a space.
-}
-- CHECK: decode1: Just "hello world"
-- CHECK: decode2: Just "a&b=c"
-- CHECK: decode3: Just "a+b"
import Html exposing (text)
import Url
main =
let
_ = Debug.log "decode1" (Url.percentDecode "hello%20world")
_ = Debug.log "decode2" (Url.percentDecode "a%26b%3Dc")
_ = Debug.log "decode3" (Url.percentDecode "a+b")
in
text "done"