diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 23:34:51 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 23:34:51 +0200 |
| commit | 3990586a85e91923c0a3ae1a1f0f61420db555ac (patch) | |
| tree | 041692e7961cb66333b2c7b47d32a25487c6522d /internal/engine/exclude_test.go | |
| parent | 01b0cfe2055e23cf03870d9a9f60648037b4005e (diff) | |
| download | krino-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.go | 21 |
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) + } +} |
