aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/system/acl_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/system/acl_test.go')
-rw-r--r--internal/system/acl_test.go19
1 files changed, 10 insertions, 9 deletions
diff --git a/internal/system/acl_test.go b/internal/system/acl_test.go
index fe456c70..ed449ef3 100644
--- a/internal/system/acl_test.go
+++ b/internal/system/acl_test.go
@@ -49,21 +49,22 @@ func TestUpdatePermType(t *testing.T) {
func TestACL_String(t *testing.T) {
testCases := []struct {
want string
+ et Enablement
perms []acl.Perm
}{
- {"---", []acl.Perm{}},
- {"r--", []acl.Perm{acl.Read}},
- {"-w-", []acl.Perm{acl.Write}},
- {"--x", []acl.Perm{acl.Execute}},
- {"rw-", []acl.Perm{acl.Read, acl.Write}},
- {"r-x", []acl.Perm{acl.Read, acl.Execute}},
- {"rwx", []acl.Perm{acl.Read, acl.Write, acl.Execute}},
- {"rwx", []acl.Perm{acl.Read, acl.Write, acl.Write, acl.Execute}},
+ {`--- type: Process path: "/nonexistent"`, Process, []acl.Perm{}},
+ {`r-- type: User path: "/nonexistent"`, User, []acl.Perm{acl.Read}},
+ {`-w- type: Wayland path: "/nonexistent"`, EWayland, []acl.Perm{acl.Write}},
+ {`--x type: X11 path: "/nonexistent"`, EX11, []acl.Perm{acl.Execute}},
+ {`rw- type: D-Bus path: "/nonexistent"`, EDBus, []acl.Perm{acl.Read, acl.Write}},
+ {`r-x type: PulseAudio path: "/nonexistent"`, EPulse, []acl.Perm{acl.Read, acl.Execute}},
+ {`rwx type: User path: "/nonexistent"`, User, []acl.Perm{acl.Read, acl.Write, acl.Execute}},
+ {`rwx type: Process path: "/nonexistent"`, Process, []acl.Perm{acl.Read, acl.Write, acl.Write, acl.Execute}},
}
for _, tc := range testCases {
t.Run(tc.want, func(t *testing.T) {
- a := &ACL{perms: tc.perms}
+ a := &ACL{et: tc.et, perms: tc.perms, path: "/nonexistent"}
if got := a.String(); got != tc.want {
t.Errorf("String() = %v, want %v",
got, tc.want)