aboutsummaryrefslogtreecommitdiffhomepage
path: root/vfs/mangle_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-03-17 15:16:46 +0900
committerOphestra <cat@gensokyo.uk>2026-03-17 15:30:30 +0900
commite9a72490db44426605debd3cc756a7924931d706 (patch)
tree1e8f8099c46aa16023367404ec2c9fb769db2c8e /vfs/mangle_test.go
parent0a12d456ce5869042dc06c43c360c43cab942d6b (diff)
vfs: move from container
This package is not container-specific. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'vfs/mangle_test.go')
-rw-r--r--vfs/mangle_test.go30
1 files changed, 30 insertions, 0 deletions
diff --git a/vfs/mangle_test.go b/vfs/mangle_test.go
new file mode 100644
index 00000000..91abdb36
--- /dev/null
+++ b/vfs/mangle_test.go
@@ -0,0 +1,30 @@
+package vfs_test
+
+import (
+ "testing"
+
+ "hakurei.app/vfs"
+)
+
+func TestUnmangle(t *testing.T) {
+ t.Parallel()
+
+ testCases := []struct {
+ want string
+ sample string
+ }{
+ {`\, `, `\134\054\040`},
+ {`(10) source -- maybe empty string`, `(10)\040source\040--\040maybe empty string`},
+ }
+
+ for _, tc := range testCases {
+ t.Run(tc.want, func(t *testing.T) {
+ t.Parallel()
+ got := vfs.Unmangle(tc.sample)
+ if got != tc.want {
+ t.Errorf("Unmangle: %q, want %q",
+ got, tc.want)
+ }
+ })
+ }
+}