test: log test failed

This commit is contained in:
某文 2023-05-24 21:06:15 +08:00
parent 28015597ee
commit 8816da41a6
1 changed files with 19 additions and 3 deletions

View File

@ -444,7 +444,7 @@ log_path_test_() ->
#{<<"log">> => #{<<"file_handlers">> => #{<<"name1">> => #{<<"file">> => Path}}}} #{<<"log">> => #{<<"file_handlers">> => #{<<"name1">> => #{<<"file">> => Path}}}}
end, end,
Assert = fun(Name, Path, Conf) -> Assert = fun(Name, Path, Conf) ->
?assertMatch(#{log := #{file_handlers := #{Name := #{file := Path}}}}, Conf) ?assertMatch(#{log := #{file := #{Name := #{to := Path}}}}, Conf)
end, end,
[ [
@ -457,7 +457,15 @@ log_path_test_() ->
{emqx_conf_schema, [ {emqx_conf_schema, [
#{ #{
kind := validation_error, kind := validation_error,
reason := {"bad_file_path_string", _} mismatches :=
#{
"handler_name" :=
#{
kind := validation_error,
path := "log.file.name1.to",
reason := {"bad_file_path_string", _}
}
}
} }
]}, ]},
check(Fh(<<239, 32, 132, 47, 117, 116, 102, 56>>)) check(Fh(<<239, 32, 132, 47, 117, 116, 102, 56>>))
@ -468,7 +476,15 @@ log_path_test_() ->
{emqx_conf_schema, [ {emqx_conf_schema, [
#{ #{
kind := validation_error, kind := validation_error,
reason := {"not_string", _} mismatches :=
#{
"handler_name" :=
#{
kind := validation_error,
path := "log.file.name1.to",
reason := {"not_string", _}
}
}
} }
]}, ]},
check(Fh(#{<<"foo">> => <<"bar">>})) check(Fh(#{<<"foo">> => <<"bar">>}))