From f6bda923976790a200ba92b65c9fb2613aad4704 Mon Sep 17 00:00:00 2001 From: Spencer Brower <6729162+sbrow@users.noreply.github.com> Date: Wed, 12 Aug 2026 10:16:43 -0400 Subject: [PATCH] test: removed `nil_logger` from tests. Tests always pass with it. --- menus_test.odin | 5 ----- mustache/diagnostic_test.odin | 1 + mustache/mustache_test.odin | 3 --- mustache/spec_test.odin | 5 ----- site_test.odin | 8 -------- 5 files changed, 1 insertion(+), 21 deletions(-) diff --git a/menus_test.odin b/menus_test.odin index a8b7adf..220fa2e 100644 --- a/menus_test.odin +++ b/menus_test.odin @@ -100,7 +100,6 @@ test_menus_nil_input :: proc(t: ^testing.T) { @(test) test_menus_invalid_type :: proc(t: ^testing.T) { - context.logger = log.nil_logger() arena: mem.Dynamic_Arena mem.dynamic_arena_init(&arena) defer mem.dynamic_arena_destroy(&arena) @@ -113,7 +112,6 @@ test_menus_invalid_type :: proc(t: ^testing.T) { @(test) test_menus_array_non_string :: proc(t: ^testing.T) { - context.logger = log.nil_logger() arena: mem.Dynamic_Arena mem.dynamic_arena_init(&arena) defer mem.dynamic_arena_destroy(&arena) @@ -130,7 +128,6 @@ test_menus_array_non_string :: proc(t: ^testing.T) { @(test) test_menus_object_non_object_value :: proc(t: ^testing.T) { - context.logger = log.nil_logger() arena: mem.Dynamic_Arena mem.dynamic_arena_init(&arena) defer mem.dynamic_arena_destroy(&arena) @@ -146,7 +143,6 @@ test_menus_object_non_object_value :: proc(t: ^testing.T) { @(test) test_menus_non_numeric_weight :: proc(t: ^testing.T) { - context.logger = log.nil_logger() arena: mem.Dynamic_Arena mem.dynamic_arena_init(&arena) defer mem.dynamic_arena_destroy(&arena) @@ -161,7 +157,6 @@ test_menus_non_numeric_weight :: proc(t: ^testing.T) { @(test) test_menus_empty_title :: proc(t: ^testing.T) { - context.logger = log.nil_logger() arena: mem.Dynamic_Arena mem.dynamic_arena_init(&arena) defer mem.dynamic_arena_destroy(&arena) diff --git a/mustache/diagnostic_test.odin b/mustache/diagnostic_test.odin index 120d647..847d234 100644 --- a/mustache/diagnostic_test.odin +++ b/mustache/diagnostic_test.odin @@ -3,6 +3,7 @@ package mustache import "core:encoding/json" import "core:fmt" +import "core:log" import "core:os" import "core:path/filepath" import "core:strings" diff --git a/mustache/mustache_test.odin b/mustache/mustache_test.odin index 06e5f34..701b9e9 100644 --- a/mustache/mustache_test.odin +++ b/mustache/mustache_test.odin @@ -1,7 +1,6 @@ #+test package mustache -import "core:log" import "core:mem" import "core:strings" import "core:testing" @@ -130,8 +129,6 @@ leak_repeated_render :: proc(t: ^testing.T) { // The depth warning must be non-fatal: rendering still succeeds. @(test) test_context_depth_warns :: proc(t: ^testing.T) { - context.logger = log.nil_logger() - AMT :: MAX_CONTEXT_DEPTH + 2 // Build AMT nested {x: {...}} levels; the innermost holds `leaf`. diff --git a/mustache/spec_test.odin b/mustache/spec_test.odin index 56926c2..722ce3f 100644 --- a/mustache/spec_test.odin +++ b/mustache/spec_test.odin @@ -3,7 +3,6 @@ package mustache import "core:encoding/json" import "core:fmt" -import "core:log" import "core:os" import "core:path/filepath" import "core:testing" @@ -55,10 +54,6 @@ run_one_test :: proc( test: json.Object, name, template_src, expected: string, ) -> bool { - // Spec tests deliberately exercise missing keys, missing partials, etc. - // Silence the warnings to keep test output readable. - context.logger = log.nil_logger() - partials := make_map(map[string]Template, context.temp_allocator) if "partials" in test { diff --git a/site_test.odin b/site_test.odin index 0599126..fc09978 100644 --- a/site_test.odin +++ b/site_test.odin @@ -5,7 +5,6 @@ package main import "core:encoding/json" import "core:flags" import "core:fmt" -import "core:log" import "core:os" import "core:testing" import "core:time/datetime" @@ -84,7 +83,6 @@ test_load_config_file_invalid_json :: proc(t: ^testing.T) { cfg: Config_File ok := false { - context.logger = log.nil_logger() ok = load_config_file(&cfg, path, context.temp_allocator) } testing.expect(t, !ok) @@ -106,7 +104,6 @@ test_load_config_file_partial :: proc(t: ^testing.T) { @(test) test_init_site_defaults_no_config :: proc(t: ^testing.T) { - context.logger = log.nil_logger() site: Site _flags: Flags @@ -126,7 +123,6 @@ test_init_site_defaults_no_config :: proc(t: ^testing.T) { @(test) test_init_site_config_dir_relative :: proc(t: ^testing.T) { - context.logger = log.nil_logger() site: Site _flags: Flags @@ -142,7 +138,6 @@ test_init_site_config_dir_relative :: proc(t: ^testing.T) { @(test) test_init_site_flag_overrides_default :: proc(t: ^testing.T) { - context.logger = log.nil_logger() site: Site _flags: Flags @@ -156,7 +151,6 @@ test_init_site_flag_overrides_default :: proc(t: ^testing.T) { @(test) test_init_site_full_pipeline :: proc(t: ^testing.T) { - context.logger = log.nil_logger() path := write_temp_config( "pipeline", @@ -178,7 +172,6 @@ test_init_site_full_pipeline :: proc(t: ^testing.T) { @(test) test_init_site_md_enable_disable :: proc(t: ^testing.T) { - context.logger = log.nil_logger() site: Site _flags: Flags @@ -199,7 +192,6 @@ test_init_site_md_enable_disable :: proc(t: ^testing.T) { @(test) test_init_site_config_paths :: proc(t: ^testing.T) { - context.logger = log.nil_logger() path := write_temp_config( "paths",