Ver código fonte

Use triq instead of proper

pull/80/head
Alexander Shorin 10 anos atrás
pai
commit
5e8282f76e
3 arquivos alterados com 11 adições e 52 exclusões
  1. +4
    -0
      rebar.config
  2. +0
    -37
      rebar.config.script
  3. +7
    -15
      test/jiffy_11_proper_tests.erl

+ 4
- 0
rebar.config Ver arquivo

@ -1,3 +1,7 @@
{deps, [
{triq, ".*", {git, "git://github.com/krestenkrab/triq.git", "master"}}
]}.
{port_specs, [
{"priv/jiffy.so", [
"c_src/*.c",

+ 0
- 37
rebar.config.script Ver arquivo

@ -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.

+ 7
- 15
test/jiffy_11_proper_tests.erl Ver arquivo

@ -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.

Carregando…
Cancelar
Salvar