Skip to content

Commit

Permalink
Add test improvements to check for both no equal sign and no value
Browse files Browse the repository at this point in the history
  • Loading branch information
codeadict committed Feb 9, 2020
1 parent 61d6733 commit 06247fd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/clique_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -380,8 +380,13 @@ parse_valid_arg_value_with_equal_sign_test() ->
%% All arguments must be of type k=v
parse_invalid_kv_arg_test() ->
Spec = spec(),
Args = ["ayo="],
?assertMatch({error, _}, parse({Spec, Args})).
%% Argument with equal sign and no value
ArgsNoVal = ["ayo="],
?assertMatch({error, {invalid_kv_arg, _}}, parse({Spec, ArgsNoVal})),
%% Argument without equal sign and no value
ArgsNoEqualAndNoVal = ["ayo"],
?assertMatch({error, {invalid_kv_arg, _}}, parse({Spec, ArgsNoEqualAndNoVal})).


%% This succeeds, because we aren't validating the flag, just parsing
%% Note: Short flags get parsed into tuples with their character as first elem
Expand Down

0 comments on commit 06247fd

Please sign in to comment.