fix(chrome): keep a log entry the level scale cannot rank

Claude-Session: https://claude.ai/code/session_01ShuAy8q8ZfPi8KHxwc8JpQ
This commit is contained in:
pj committed 2026-08-16 01:23:17 +05:30
1 parent a4c2a6b91c
commit 9b1fbdf60f
2 files changed
+42 -1

No files matched your search

+33
View File
@@ -0,0 +1,33 @@
package chrome
import "testing"
// A level the scale does not name is unknown, not verbose. Ranking it below
// every threshold is what silently emptied the web log channel: the entries
// existed, the filter dropped them, and the run reported nothing. Evidence the
// filter cannot rank has to reach the caller, who can at least see it.
func TestMeetsLevel(t *testing.T) {
cases := []struct {
level string
minLevel string
want bool
}{
{"E", "E", true},
{"F", "E", true},
{"W", "E", false},
{"I", "E", false},
{"D", "E", false},
{"V", "E", false},
{"W", "W", true},
{"I", "W", false},
{"D", "V", true},
{"ERROR", "E", true},
{"WARNING", "E", true},
{"", "E", true},
}
for _, tc := range cases {
if got := meetsLevel(tc.level, tc.minLevel); got != tc.want {
t.Errorf("meetsLevel(%q, %q) = %v, want %v", tc.level, tc.minLevel, got, tc.want)
}
}
}