From 8816da41a6d51b7a46ee3057c05ced8d2353a1b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9F=90=E6=96=87?= Date: Wed, 24 May 2023 21:06:15 +0800 Subject: [PATCH] test: log test failed --- .../emqx_conf/test/emqx_conf_schema_tests.erl | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/apps/emqx_conf/test/emqx_conf_schema_tests.erl b/apps/emqx_conf/test/emqx_conf_schema_tests.erl index 0f0cb3de1..32c66fb90 100644 --- a/apps/emqx_conf/test/emqx_conf_schema_tests.erl +++ b/apps/emqx_conf/test/emqx_conf_schema_tests.erl @@ -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,7 +457,15 @@ log_path_test_() -> {emqx_conf_schema, [ #{ 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>>)) @@ -468,7 +476,15 @@ log_path_test_() -> {emqx_conf_schema, [ #{ kind := validation_error, - reason := {"not_string", _} + mismatches := + #{ + "handler_name" := + #{ + kind := validation_error, + path := "log.file.name1.to", + reason := {"not_string", _} + } + } } ]}, check(Fh(#{<<"foo">> => <<"bar">>}))