diff options
author | Péter Dimitrov <[email protected]> | 2017-10-25 10:11:14 +0200 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2017-10-25 11:17:29 +0200 |
commit | 992cda82f16ee23b0114563858d5a082711f659b (patch) | |
tree | b6f86f3dbec15036552ff46cfa23edee53b0d929 /lib/stdlib/test | |
parent | 3c80849dc9167018a66542b76b441e675d404a78 (diff) | |
download | otp-992cda82f16ee23b0114563858d5a082711f659b.tar.gz otp-992cda82f16ee23b0114563858d5a082711f659b.tar.bz2 otp-992cda82f16ee23b0114563858d5a082711f659b.zip |
stdlib: Refactor compose_query
Diffstat (limited to 'lib/stdlib/test')
-rw-r--r-- | lib/stdlib/test/uri_string_SUITE.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/stdlib/test/uri_string_SUITE.erl b/lib/stdlib/test/uri_string_SUITE.erl index fe832ac82c..c230f7c631 100644 --- a/lib/stdlib/test/uri_string_SUITE.erl +++ b/lib/stdlib/test/uri_string_SUITE.erl @@ -830,10 +830,15 @@ compose_query(_Config) -> "foo=1&bar=2" = uri_string:compose_query([{"foo","1"}, {"bar", "2"}],[{separator,escaped_amp}]), "foo=1&bar=2" = uri_string:compose_query([{"foo","1"}, {"bar", "2"}],[{separator,amp}]), "foo=1;bar=2" = uri_string:compose_query([{"foo","1"}, {"bar", "2"}],[{separator,semicolon}]), - "foo+bar=1&%C3%B6=2" = uri_string:compose_query([{"foo bar","1"}, {"ö", "2"}]). + "foo+bar=1&%C3%B6=2" = uri_string:compose_query([{"foo bar","1"}, {"ö", "2"}]), + "foo+bar=1&%C3%B6=2" = uri_string:compose_query([{<<"foo bar">>,<<"1">>}, {"ö", <<"2">>}]), + <<"foo+bar=1&%C3%B6=2">> = + uri_string:compose_query([{<<"foo bar">>,<<"1">>}, {<<"ö"/utf8>>, <<"2">>}]). compose_query_negative(_Config) -> - {error,badarg,4} = uri_string:compose_query([{"",4}]). + {error,badarg,4} = uri_string:compose_query([{"",4}]), + {error,badarg,5} = uri_string:compose_query([{5,""}]), + {error,invalid_utf8,<<"ö">>} = uri_string:compose_query([{"foo bar","1"}, {<<"ö">>, "2"}]). dissect_query(_Config) -> [] = uri_string:dissect_query(""), |