generate test state from init/1' in jsx_to_term' and `jsx_to_json'

instead of doing it by hand
This commit is contained in:
alisdair sullivan 2013-10-25 01:35:39 +00:00
parent 62914f422a
commit 625f912e7b
2 changed files with 2 additions and 2 deletions

View file

@ -298,7 +298,7 @@ handle_event_test_() ->
{ {
Title, ?_assertEqual( Title, ?_assertEqual(
JSON, JSON,
lists:foldl(fun handle_event/2, {start, [], #config{}}, Events ++ [end_json]) lists:foldl(fun handle_event/2, init([]), Events ++ [end_json])
) )
} || {Title, JSON, _, Events} <- Data } || {Title, JSON, _, Events} <- Data
]. ].

View file

@ -247,7 +247,7 @@ handle_event_test_() ->
{ {
Title, ?_assertEqual( Title, ?_assertEqual(
Term, Term,
lists:foldl(fun handle_event/2, {[], #config{}}, Events ++ [end_json]) lists:foldl(fun handle_event/2, init([]), Events ++ [end_json])
) )
} || {Title, _, Term, Events} <- Data } || {Title, _, Term, Events} <- Data
]. ].