aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/vfs/mangle_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-07-03 02:59:43 +0900
committerOphestra <cat@gensokyo.uk>2025-07-03 02:59:43 +0900
commit1b5ecd9eaf3289d164d8ed1bce6013e0e4ef8e86 (patch)
tree047fe5fabdfb37d5c0088f7f572cebc8b13853bb /container/vfs/mangle_test.go
parent82561d62b66f17c05604e87f18187bb3a91f00d2 (diff)
container: move out of toplevel
This allows slightly easier use of the vanity url. This also provides some disambiguation between low level containers and hakurei app containers. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/vfs/mangle_test.go')
-rw-r--r--container/vfs/mangle_test.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/container/vfs/mangle_test.go b/container/vfs/mangle_test.go
new file mode 100644
index 00000000..d9444a84
--- /dev/null
+++ b/container/vfs/mangle_test.go
@@ -0,0 +1,27 @@
+package vfs_test
+
+import (
+ "testing"
+
+ "git.gensokyo.uk/security/hakurei/container/vfs"
+)
+
+func TestUnmangle(t *testing.T) {
+ 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) {
+ got := vfs.Unmangle(tc.sample)
+ if got != tc.want {
+ t.Errorf("Unmangle: %q, want %q",
+ got, tc.want)
+ }
+ })
+ }
+}