Skip to content

Commit c77a1c3

Browse files
committed
ensure that using ext codes outside the specified range fails
1 parent b4d2a23 commit c77a1c3

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

test/msgpack_ext_example_tests.erl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,7 @@ ext_typecode_range_test() ->
9494
Result = msgpack:unpack(Encoded, Opt),
9595
?assertMatch({ok, N}, Result)
9696
end || N <- lists:seq(TypecodeMin,TypecodeMax)],
97+
%% using codes outside the allowed range should fail:
98+
[?assertError({case_clause, _}, msgpack:pack({thing, N}, Opt))
99+
|| N <- [-129, 128]],
97100
ok.

0 commit comments

Comments
 (0)