From 6aa431d57a2c224c7974bf12d93b46475efecf6e Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sat, 30 Aug 2025 12:55:49 +0900 Subject: system/acl: update test log messages Most of these were never updated after UpdatePerm was renamed to Update. Signed-off-by: Ophestra --- system/acl/perms_test.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 system/acl/perms_test.go (limited to 'system/acl/perms_test.go') diff --git a/system/acl/perms_test.go b/system/acl/perms_test.go new file mode 100644 index 00000000..16b282a7 --- /dev/null +++ b/system/acl/perms_test.go @@ -0,0 +1,30 @@ +package acl_test + +import ( + "testing" + + "hakurei.app/system/acl" +) + +func TestPerms(t *testing.T) { + testCases := []struct { + name string + perms acl.Perms + }{ + {"---", acl.Perms{}}, + {"r--", acl.Perms{acl.Read}}, + {"-w-", acl.Perms{acl.Write}}, + {"--x", acl.Perms{acl.Execute}}, + {"rw-", acl.Perms{acl.Read, acl.Read, acl.Write}}, + {"r-x", acl.Perms{acl.Read, acl.Execute, acl.Execute}}, + {"-wx", acl.Perms{acl.Write, acl.Write, acl.Execute, acl.Execute}}, + {"rwx", acl.Perms{acl.Read, acl.Write, acl.Execute}}, + } + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + if got := tc.perms.String(); got != tc.name { + t.Errorf("String: %q, want %q", got, tc.name) + } + }) + } +} -- cgit v1.3.1