From 999dd5a2978b0b4a9f4de3b9646a0d5aa71a6c0a Mon Sep 17 00:00:00 2001 From: Nanaloveyuki Date: Sun, 14 Jun 2026 04:16:42 +0800 Subject: [PATCH] :white_check_mark: cover sync parse-build config errors --- src/BitLogger_test.mbt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/BitLogger_test.mbt b/src/BitLogger_test.mbt index db5086b..842f3b9 100644 --- a/src/BitLogger_test.mbt +++ b/src/BitLogger_test.mbt @@ -1795,3 +1795,31 @@ test "parsed configured logger keeps composition and runtime helper surface" { inspect(derived.flush(), content="2") inspect(derived.pending_count(), content="0") } + +test "sync parse-build facades forward config errors" { + let raw = "{\"sink\":{\"kind\":\"file\",\"path\":\"\"}}" + + let configured_error = (fn() -> String raise ConfigError { + ignore(parse_and_build_logger(raw)) + "no error" + })() catch { + ConfigError::InvalidConfig(message) => message + } + inspect(configured_error, content="File sink requires non-empty path") + + let application_error = (fn() -> String raise ConfigError { + ignore(parse_and_build_application_logger(raw)) + "no error" + })() catch { + ConfigError::InvalidConfig(message) => message + } + inspect(application_error, content="File sink requires non-empty path") + + let library_error = (fn() -> String raise ConfigError { + ignore(parse_and_build_library_logger(raw)) + "no error" + })() catch { + ConfigError::InvalidConfig(message) => message + } + inspect(library_error, content="File sink requires non-empty path") +}