diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 20:10:01 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 20:10:01 +0200 |
| commit | aa24cfb344b1b3eaef7217d996359023cd72ba28 (patch) | |
| tree | ee0d981d3add58451a83de13ac56be4a8b165eea /internal/config/skel_test.go | |
| parent | 00aae60378982902b871a87850e0ed427b28a347 (diff) | |
| download | krino-aa24cfb344b1b3eaef7217d996359023cd72ba28.tar.gz krino-aa24cfb344b1b3eaef7217d996359023cd72ba28.zip | |
plan 8: fuzz decoders; fold ẞ and invalid UTF-8 correctly, refuse non-UTF-8 paths in krino new
Diffstat (limited to 'internal/config/skel_test.go')
| -rw-r--r-- | internal/config/skel_test.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/internal/config/skel_test.go b/internal/config/skel_test.go index 476af65..3815336 100644 --- a/internal/config/skel_test.go +++ b/internal/config/skel_test.go @@ -5,6 +5,7 @@ package config import ( "bytes" "errors" + "fmt" "io/fs" "os" "path/filepath" @@ -242,7 +243,7 @@ func TestNewDirErrors(t *testing.T) { home := t.TempDir() t.Setenv("HOME", home) writeFiles(t, home, map[string]string{ - "krino.conf": `(include "a")`, "dirs/a.conf": `(path "~")`, "x/.keep": "", "f": "", + "krino.conf": `(include "a")`, "dirs/a.conf": `(path "~")`, "x/.keep": "", "f": "", "lat\xe9n/.keep": "", }) main := filepath.Join(home, "krino.conf") tests := []struct{ name, path, want string }{ @@ -251,6 +252,7 @@ func TestNewDirErrors(t *testing.T) { {"b", "~/f", filepath.Join(home, "f") + " is not a directory"}, {"b", "~/missing", filepath.Join(home, "missing") + " is not a directory"}, {"a", "~/x", `"a" is already included`}, + {"b", "~/lat\xe9n", fmt.Sprintf("%q is not valid UTF-8; krino's config is UTF-8 text, so rename the directory first", filepath.Join(home, "lat\xe9n"))}, } for _, tt := range tests { if _, err := NewDir(main, tt.name, tt.path); err == nil || err.Error() != tt.want { |
