aboutsummaryrefslogtreecommitdiff
path: root/internal/plan/hostile_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 23:45:23 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-14 23:45:23 +0200
commit97c8164bc81e0a438dab92d7244485005dac4ff2 (patch)
tree08d657f8b92a6539259b6aa8f08b0e9ef8cc6710 /internal/plan/hostile_test.go
parent166565025832c8a8faf7397766aeaa878980dd2d (diff)
downloadkrino-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.go5
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