aboutsummaryrefslogtreecommitdiff
path: root/internal/engine/exclude_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 23:34:51 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 23:34:51 +0200
commit3990586a85e91923c0a3ae1a1f0f61420db555ac (patch)
tree041692e7961cb66333b2c7b47d32a25487c6522d /internal/engine/exclude_test.go
parent01b0cfe2055e23cf03870d9a9f60648037b4005e (diff)
downloadkrino-3990586a85e91923c0a3ae1a1f0f61420db555ac.tar.gz
krino-3990586a85e91923c0a3ae1a1f0f61420db555ac.zip
captures keep the name's diacritics
Diffstat (limited to 'internal/engine/exclude_test.go')
-rw-r--r--internal/engine/exclude_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/internal/engine/exclude_test.go b/internal/engine/exclude_test.go
index e5231f8..e183268 100644
--- a/internal/engine/exclude_test.go
+++ b/internal/engine/exclude_test.go
@@ -330,3 +330,24 @@ func TestTextTurningBinaryIsNoText(t *testing.T) {
}
}
}
+
+// TestPlannedDestinationKeepsDiacritics: a folded name test's capture goes
+// into the destination as the file name wrote it.
+func TestPlannedDestinationKeepsDiacritics(t *testing.T) {
+ h, _ := excludeTree(t, map[string]string{"Łódź-faktura.pdf": "x"})
+ main := writeConfig(t, h, `(include "dl")`, map[string]string{"dl": `
+(path "~/dl")
+(rule "city" (when (name "^(.+)-faktura")) (move "Out/{1}"))
+`})
+ e, errs := Load(main)
+ if len(errs) > 0 {
+ t.Fatal(errs)
+ }
+ dp, err := e.Plan(context.Background(), e.Dirs[0], plan.NewClaims())
+ if err != nil {
+ t.Fatal(err)
+ }
+ if len(dp.Chains) != 1 || !strings.HasSuffix(dp.Chains[0].Steps[0].Dst, "/Out/Łódź/Łódź-faktura.pdf") {
+ t.Fatalf("chains = %+v; want the move into Out/Łódź", dp.Chains)
+ }
+}