From eec021cc4b4eb42bc9c8311755826828bfba1996 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 2 Jul 2025 21:31:29 +0900 Subject: hakurei: move container helpers toplevel Signed-off-by: Ophestra --- vfs/mangle_test.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 vfs/mangle_test.go (limited to 'vfs/mangle_test.go') diff --git a/vfs/mangle_test.go b/vfs/mangle_test.go new file mode 100644 index 00000000..54af8fbf --- /dev/null +++ b/vfs/mangle_test.go @@ -0,0 +1,27 @@ +package vfs_test + +import ( + "testing" + + "git.gensokyo.uk/security/hakurei/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) + } + }) + } +} -- cgit v1.3.1