Files
Tristan Partin 58b03ee6ae config: add ResourceDirs()
In a few places around the codebase, we had the same pattern of creating
a slice of paths pointing to specific resource directories. Let's use
a function to encapsulate the logic.

Signed-off-by: Tristan Partin <tristan@partin.io>
Acked-by: Robin Jarry <robin@jarry.cc>
2026-08-02 20:48:21 +02:00

21 lines
420 B
Go

package config
import (
"path"
"testing"
)
// Test that the function returns a non-empty slice of strings
func TestResourceDirs(t *testing.T) {
dirs := ResourceDirs("test")
if len(dirs) == 0 {
t.Errorf("Expected non-empty slice of strings, got %v", dirs)
}
for _, dir := range dirs {
if path.Base(dir) != "test" {
t.Errorf("Expected last component of path to be 'test', got %s", path.Base(dir))
}
}
}