Skip to content

Commit 87a3fb5

Browse files
authored
Merge pull request #98 from msgpack/test-str
Add property tests for string
2 parents 4523023 + 086f533 commit 87a3fb5

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/prop_msgpack.erl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,18 @@ prop_msgpack() ->
7878
{msgpack_object(), stable_opts()},
7979
pack_and_unpack(Obj, Opts)).
8080

81+
prop_string() ->
82+
?FORALL({Str, Opts},
83+
{utf8(),
84+
oneof(
85+
[
86+
[],
87+
[{unpack_str, as_list},{pack_str, from_list},{validate_string,true}],
88+
[{unpack_str, as_binary},{pack_str, from_binary},{validate_string,true}],
89+
[{unpack_str, as_tagged_list},{pack_str, from_tagged_list},{validate_string,true}]
90+
])},
91+
pack_and_unpack(unicode:characters_to_list(Str), Opts)).
92+
8193

8294
%%% Helpers %%%
8395
pack_and_unpack(Obj, Opts) ->

0 commit comments

Comments
 (0)