Procházet zdrojové kódy

first approach to property-based testing

pull/8/merge^2
Groshev Dmitry před 13 roky
rodič
revize
26c0a2e905
1 změnil soubory, kde provedl 25 přidání a 0 odebrání
  1. +25
    -0
      test/jiffy_SUITE.erl

+ 25
- 0
test/jiffy_SUITE.erl Zobrazit soubor

@ -0,0 +1,25 @@
-module(jiffy_SUITE).
-include_lib("proper/include/proper.hrl").
-include_lib("proper_stdlib/include/proper_ct.hrl").
-compile(export_all).
all() -> proper_ct:testcases(?MODULE).
init_per_testcase(tc_prop_foo, Config) ->
[{proper, [{numtests, 1000}]} | Config].
-type json_any() :: json_list()
| json_dict()
| json_number()
| json_string()
| json_null().
-type json_list() :: list(json_any()).
-type json_dict() :: {[{json_key(), json_any()}]}.
-type json_key() :: binary().
-type json_number() :: integer() | float().
-type json_string() :: binary().
-type json_null() :: null.
prop_foo() ->
?FORALL(Data, json_any(),
Data == jiffy:decode(jiffy:encode(Data))).

Načítá se…
Zrušit
Uložit