mirror of
https://github.com/correl/urilib.git
synced 2024-11-21 19:18:42 +00:00
Add test, remove encode/2, encode_plus/2
This commit is contained in:
parent
1b2d43437d
commit
f16b0be421
2 changed files with 5 additions and 12 deletions
|
@ -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()
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in a new issue