aboutsummaryrefslogtreecommitdiffhomepage
path: root/check/overlay_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-17 15:35:58 +0900
committerOphestra <cat@gensokyo.uk>2026-03-17 15:39:03 +0900
commit6d015a949e27f20c86409c7d78053f0b0493f165 (patch)
tree4d2bc1e9596fa30ea03e4c0cc575e6a7a969249d /check/overlay_test.go
parente9a72490db44426605debd3cc756a7924931d706 (diff)
check: move from container
This package is not container specific, and widely used across the project. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'check/overlay_test.go')
-rw-r--r--check/overlay_test.go31
1 files changed, 31 insertions, 0 deletions
diff --git a/check/overlay_test.go b/check/overlay_test.go
new file mode 100644
index 00000000..9b32dbcb
--- /dev/null
+++ b/check/overlay_test.go
@@ -0,0 +1,31 @@
+package check_test
+
+import (
+ "testing"
+
+ "hakurei.app/check"
+)
+
+func TestEscapeOverlayDataSegment(t *testing.T) {
+ t.Parallel()
+
+ testCases := []struct {
+ name string
+ s string
+ want string
+ }{
+ {"zero", "", ""},
+ {"multi", `\\\:,:,\\\`, `\\\\\\\:\,\:\,\\\\\\`},
+ {"bwrap", `/path :,\`, `/path \:\,\\`},
+ }
+
+ for _, tc := range testCases {
+ t.Run(tc.name, func(t *testing.T) {
+ t.Parallel()
+
+ if got := check.EscapeOverlayDataSegment(tc.s); got != tc.want {
+ t.Errorf("escapeOverlayDataSegment: %s, want %s", got, tc.want)
+ }
+ })
+ }
+}