Skip to content

Commit 086f533

Browse files
committed
Add property tests for string
1 parent 4523023 commit 086f533

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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)