first tentative steps towards more comprehensive and flexible test suite
This commit is contained in:
parent
51cafcfb64
commit
ba42f75780
3 changed files with 31 additions and 18 deletions
20
src/jsx.erl
20
src/jsx.erl
|
@ -34,9 +34,8 @@
|
|||
|
||||
-export_type([json_term/0, json_text/0]).
|
||||
|
||||
%% test handler
|
||||
-ifdef(TEST).
|
||||
-export([init/1, handle_event/2]).
|
||||
-include("jsx_tests.hrl").
|
||||
-endif.
|
||||
|
||||
|
||||
|
@ -151,19 +150,4 @@ encoder(Handler, State, Opts) -> jsx_encoder:encoder(Handler, State, Opts).
|
|||
|
||||
-spec parser(Handler::module(), State::any(), Opts::list()) -> parser().
|
||||
|
||||
parser(Handler, State, Opts) -> jsx_parser:parser(Handler, State, Opts).
|
||||
|
||||
|
||||
|
||||
-ifdef(TEST).
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
|
||||
%% stub test handler
|
||||
init([]) -> [].
|
||||
|
||||
handle_event(end_json, State) -> lists:reverse([end_json] ++ State);
|
||||
handle_event(Event, State) -> [Event] ++ State.
|
||||
|
||||
|
||||
-endif.
|
||||
parser(Handler, State, Opts) -> jsx_parser:parser(Handler, State, Opts).
|
Loading…
Add table
Add a link
Reference in a new issue