From 2757699c6645ca54cde4c00ff1b079bfa01d2b39 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sun, 20 Apr 2025 18:39:09 -0400 Subject: lib: add missing test Signed-off-by: Xe Iaso --- lib/anubis_test.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/anubis_test.go b/lib/anubis_test.go index eca6869..60b7913 100644 --- a/lib/anubis_test.go +++ b/lib/anubis_test.go @@ -8,6 +8,7 @@ import ( "testing" "github.com/TecharoHQ/anubis" + "github.com/TecharoHQ/anubis/data" "github.com/TecharoHQ/anubis/internal" "github.com/TecharoHQ/anubis/lib/policy" ) @@ -56,7 +57,19 @@ func makeChallenge(t *testing.T, ts *httptest.Server) challenge { } func TestLoadPolicies(t *testing.T) { + for _, fname := range []string{"botPolicies.json", "botPolicies.yaml"} { + t.Run(fname, func(t *testing.T) { + fin, err := data.BotPolicies.Open(fname) + if err != nil { + t.Fatal(err) + } + defer fin.Close() + if _, err := policy.ParseConfig(fin, fname, 4); err != nil { + t.Fatal(err) + } + }) + } } // Regression test for CVE-2025-24369 -- cgit v1.2.3