diff --git a/rebar.config b/rebar.config index e805dba6..0a3a2302 100644 --- a/rebar.config +++ b/rebar.config @@ -1,3 +1,7 @@ +{deps, [ + {triq, ".*", {git, "git://github.com/krestenkrab/triq.git", "master"}} +]}. + {port_specs, [ {"priv/jiffy.so", [ "c_src/*.c", diff --git a/rebar.config.script b/rebar.config.script deleted file mode 100644 index e5f561d8..00000000 --- a/rebar.config.script +++ /dev/null @@ -1,37 +0,0 @@ -% This file is part of Jiffy released under the MIT license. -% See the LICENSE file for more information. - -% Only include PropEr as a dependency when the JIFFY_DEV -% environment variable is defined. This allows downstream -% applications to avoid requiring PropEr. -% -% This script is based on the example provided with Rebar. - -ErlOpts = [{d, 'JIFFY_DEV'}], - -Proper = [ - {proper, ".*", {git, "git://github.com/manopapad/proper.git", "master"}} -], - -ConfigPath = filename:dirname(SCRIPT), -DevMarker = filename:join([ConfigPath, ".jiffy.dev"]), - -case filelib:is_file(DevMarker) orelse os:getenv("TRAVIS") == "true" of - true -> - % Don't override existing dependencies - Config0 = case lists:keyfind(deps, 1, CONFIG) of - false -> - CONFIG ++ [{deps, Proper}]; - {deps, DepsList} -> - lists:keyreplace(deps, 1, CONFIG, {deps, DepsList ++ Proper}) - end, - Config1 = case lists:keyfind(erl_opts, 1, Config0) of - false -> - Config0 ++ [{erl_opts, ErlOpts}]; - {erl_opts, Opts} -> - NewOpts = {erl_opts, Opts ++ ErlOpts}, - lists:keyreplace(erl_opts, 1, Config0, NewOpts) - end; - false -> - CONFIG -end. diff --git a/test/jiffy_11_proper_tests.erl b/test/jiffy_11_proper_tests.erl index 2c254bff..45defc4e 100644 --- a/test/jiffy_11_proper_tests.erl +++ b/test/jiffy_11_proper_tests.erl @@ -3,21 +3,15 @@ -module(jiffy_11_proper_tests). --ifdef(JIFFY_DEV). --include_lib("proper/include/proper.hrl"). +-include_lib("triq/include/triq.hrl"). -include_lib("eunit/include/eunit.hrl"). -include("jiffy_util.hrl"). -opts() -> - [ - {max_size, 15}, - {numtests, 1000} - ]. run(Name) -> {msg("~s", [Name]), [ - {timeout, 300, ?_assert(proper:quickcheck(?MODULE:Name(), opts()))} + {timeout, 300, ?_assert(triq:check(?MODULE:Name(), 10))} ]}. proper_encode_decode_test_() -> @@ -84,7 +78,7 @@ json_boolean() -> json_number() -> - oneof([integer(), float()]). + oneof([int(), real()]). json_string() -> @@ -96,7 +90,7 @@ json_list(S) when S =< 0 -> json_list(S) -> ?LETSHRINK( [ListSize], - [integer(0, S)], + [int(0, S)], vector(ListSize, json_text(S - ListSize)) ). @@ -106,7 +100,7 @@ json_object(S) when S =< 0 -> json_object(S) -> ?LETSHRINK( [ObjectSize], - [integer(0, S)], + [int(0, S)], {vector(ObjectSize, {json_string(), json_text(S - ObjectSize)})} ). @@ -121,7 +115,7 @@ json_value() -> json_text(S) when S > 0 -> - ?LAZY(oneof([ + ?DELAY(oneof([ json_list(S), json_object(S) ])); @@ -151,7 +145,7 @@ escaped_utf8_bin() -> escaped_char() -> - ?LET(C, char(), + ?LET(C, unicode_char(), case C of $" -> "\\\""; C when C == 65534 -> 65533; @@ -160,5 +154,3 @@ escaped_char() -> C -> C end ). - --endif.