Add test, remove encode/2, encode_plus/2

This commit is contained in:
Gavin M. Roy 2016-01-08 22:39:08 -05:00
parent 1b2d43437d
commit f16b0be421
2 changed files with 5 additions and 12 deletions

View file

@ -11,9 +11,7 @@
parse_uri/1,
parse_url/1,
encode/1,
encode/2,
encode_plus/1,
encode_plus/2,
decode/1,
decode_plus/1]).
@ -61,11 +59,6 @@ encode(Value) ->
edoc_lib:escape_uri(Value).
-spec encode(string(), string()) -> string().
encode(_Value, _Safe) ->
ok.
-spec encode_plus(string()) -> string().
%% @spec encode_plus(Value) -> EncodedValue
%% where
@ -81,11 +74,6 @@ encode_plus(Value) ->
string:join([edoc_lib:escape_uri(V) || V <- string:tokens(Value, " ")], "+").
-spec encode_plus(string(), string()) -> string().
encode_plus(_Value, _Safe) ->
ok.
%% @spec decode(Value) -> DecodedValue
%% where
%% Value = string()

View file

@ -8,6 +8,11 @@ decode_test() ->
Expect = "foo/bar baz",
?assertEqual(Expect, urilib:decode(Value)).
decode_plus_test() ->
Value = "foo/bar+baz",
Expect = "foo/bar baz",
?assertEqual(Expect, urilib:decode_plus(Value)).
encode1_test() ->
Value = "foo/bar baz",
Expect = "foo%2fbar%20baz",