forked from security/hakurei
internal/system: relocate from system
These packages are highly specific to hakurei and are difficult to use safely from other pieces of code. Their exported symbols are made available until v0.4.0 where they will be removed for #24. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
30
internal/system/acl/perms_test.go
Normal file
30
internal/system/acl/perms_test.go
Normal file
@@ -0,0 +1,30 @@
|
||||
package acl_test
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"hakurei.app/internal/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)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user