add tests for stricter parsing of opts
This commit is contained in:
parent
231a55c7e1
commit
81f0321e32
2 changed files with 6 additions and 2 deletions
|
@ -137,7 +137,9 @@ opts_test_() ->
|
||||||
#opts{post_decode=F},
|
#opts{post_decode=F},
|
||||||
parse_opts([{post_decode, F}])
|
parse_opts([{post_decode, F}])
|
||||||
)},
|
)},
|
||||||
{"post decode wrong arity", ?_assertError(badarg, parse_opts([{post_decode, G}]))}
|
{"post decode wrong arity", ?_assertError(badarg, parse_opts([{post_decode, G}]))},
|
||||||
|
{"invalid opt flag", ?_assertError(badarg, parse_opts([error]))},
|
||||||
|
{"invalid opt tuple", ?_assertError(badarg, parse_opts([{error, true}]))}
|
||||||
].
|
].
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,9 @@ opts_test_() ->
|
||||||
{"repeated keys false", ?_assertEqual(
|
{"repeated keys false", ?_assertEqual(
|
||||||
#opts{repeated_keys=false},
|
#opts{repeated_keys=false},
|
||||||
parse_opts([{repeated_keys, false}])
|
parse_opts([{repeated_keys, false}])
|
||||||
)}
|
)},
|
||||||
|
{"invalid opt flag", ?_assertError(badarg, parse_opts([error]))},
|
||||||
|
{"invalid opt tuple", ?_assertError(badarg, parse_opts([{error, true}]))}
|
||||||
].
|
].
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue