diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 23:45:23 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-14 23:45:23 +0200 |
| commit | 97c8164bc81e0a438dab92d7244485005dac4ff2 (patch) | |
| tree | 08d657f8b92a6539259b6aa8f08b0e9ef8cc6710 /internal/plan/hostile_test.go | |
| parent | 166565025832c8a8faf7397766aeaa878980dd2d (diff) | |
| download | krino-97c8164bc81e0a438dab92d7244485005dac4ff2.tar.gz krino-97c8164bc81e0a438dab92d7244485005dac4ff2.zip | |
literal braces are text, not placeholders, for containment and walk exclusion
Diffstat (limited to 'internal/plan/hostile_test.go')
| -rw-r--r-- | internal/plan/hostile_test.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/internal/plan/hostile_test.go b/internal/plan/hostile_test.go index a2f2bfe..13c2afd 100644 --- a/internal/plan/hostile_test.go +++ b/internal/plan/hostile_test.go @@ -48,6 +48,11 @@ func TestBuildRefusesDotDotFromPlaceholder(t *testing.T) { if s := step("/w/{1}x"); s.Skip != "" || s.Dst != "/w/..x/x.pdf" { t.Errorf("..x: Skip = %q, Dst = %q", s.Skip, s.Dst) } + // "{{" is a literal brace, not a placeholder: the text names /w/{x}, and + // a capture may not climb out of it (triage 28b). + if s := step("/w/{{x}}/{1}/in"); s.Skip != `destination "/w/{x}/../in" leaves /w/{x} through a placeholder` { + t.Errorf("literal braces: Skip = %q, Dst = %q", s.Skip, s.Dst) + } } // TestBuildKeepsPlaceholdersInsideTheirDirectory: a capture of "~", an |
