From 8e208ca5fd0fa10065d4d4efb61f07f4a08d70cf Mon Sep 17 00:00:00 2001 From: Dmitry Groshev Date: Sun, 13 Nov 2011 23:29:17 +0400 Subject: [PATCH] adding more tests --- test/proper_tests.erl | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/proper_tests.erl b/test/proper_tests.erl index 1d49019..df64605 100644 --- a/test/proper_tests.erl +++ b/test/proper_tests.erl @@ -77,7 +77,28 @@ prop_encode_decode() -> Data == jiffy:decode(jiffy:encode(Data)) end). +prop_encode_not_crash() -> + ?FORALL(Data, any(), + begin + catch jiffy:encode(Data), + true + end). + +prop_decode_not_crash_bin() -> + ?FORALL(Data, binary(), + begin + catch jiffy:decode(Data), + true + end). + +prop_decode_not_crash_any() -> + ?FORALL(Data, any(), + begin + catch jiffy:decode(Data), + true + end). + proper_test_() -> {timeout, 3600, ?_assertEqual([], proper:module(proper_tests, [{to_file, user}, - {numtests, 1000}]))}. + {numtests, 5000}]))}.