aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/uri_string_SUITE.erl
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2017-10-25 10:11:14 +0200
committerPéter Dimitrov <[email protected]>2017-10-25 11:17:29 +0200
commit992cda82f16ee23b0114563858d5a082711f659b (patch)
treeb6f86f3dbec15036552ff46cfa23edee53b0d929 /lib/stdlib/test/uri_string_SUITE.erl
parent3c80849dc9167018a66542b76b441e675d404a78 (diff)
downloadotp-992cda82f16ee23b0114563858d5a082711f659b.tar.gz
otp-992cda82f16ee23b0114563858d5a082711f659b.tar.bz2
otp-992cda82f16ee23b0114563858d5a082711f659b.zip
stdlib: Refactor compose_query
Diffstat (limited to 'lib/stdlib/test/uri_string_SUITE.erl')
-rw-r--r--lib/stdlib/test/uri_string_SUITE.erl9
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&amp;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&amp;%C3%B6=2" = uri_string:compose_query([{"foo bar","1"}, {"ö", "2"}]).
+ "foo+bar=1&amp;%C3%B6=2" = uri_string:compose_query([{"foo bar","1"}, {"ö", "2"}]),
+ "foo+bar=1&amp;%C3%B6=2" = uri_string:compose_query([{<<"foo bar">>,<<"1">>}, {"ö", <<"2">>}]),
+ <<"foo+bar=1&amp;%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(""),