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}}}}
end,
Assert = fun(Name, Path, Conf) ->
?assertMatch(#{log := #{file_handlers := #{Name := #{file := Path}}}}, Conf)
?assertMatch(#{log := #{file := #{Name := #{to := Path}}}}, Conf)
end,
[
@ -457,8 +457,16 @@ log_path_test_() ->
{emqx_conf_schema, [
#{
kind := validation_error,
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>>))
)
@ -468,8 +476,16 @@ log_path_test_() ->
{emqx_conf_schema, [
#{
kind := validation_error,
mismatches :=
#{
"handler_name" :=
#{
kind := validation_error,
path := "log.file.name1.to",
reason := {"not_string", _}
}
}
}
]},
check(Fh(#{<<"foo">> => <<"bar">>}))
)