chore: fix ct failed

This commit is contained in:
Zhongwen Deng 2022-02-25 00:01:39 +08:00
parent db584f79d6
commit 114db2d14e
1 changed files with 5 additions and 2 deletions

View File

@ -28,9 +28,12 @@ check_fields({FieldName, FieldValue}) ->
?assert(is_atom(FieldName)), ?assert(is_atom(FieldName)),
if if
is_map(FieldValue) -> is_map(FieldValue) ->
ct:pal("~p~n", [{FieldName, FieldValue}]),
?assert( ?assert(
(maps:is_key(type, FieldValue) andalso maps:is_key(default, FieldValue)) orelse (maps:is_key(type, FieldValue)
((maps:is_key(required, FieldValue) andalso maps:get(required, FieldValue))) andalso maps:is_key(default, FieldValue))
orelse ((maps:is_key(required, FieldValue)
andalso maps:get(required, FieldValue) =:= false))
); );
true -> true ->
?assert(is_function(FieldValue)) ?assert(is_function(FieldValue))