aboutsummaryrefslogtreecommitdiffhomepage
path: root/system/op_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-03-25 04:42:30 +0900
committerOphestra <cat@gensokyo.uk>2025-03-25 04:42:30 +0900
commitec5e91b8c97f02707a70a789ba4af84d51394ea5 (patch)
tree45f05e1315063936741ddafde8b5f95338315b54 /system/op_test.go
parentee51320abfeafabecd42659a88af9dfd44308a3a (diff)
system: optimise string formatting
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'system/op_test.go')
-rw-r--r--system/op_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/system/op_test.go b/system/op_test.go
index 9d179699..5fb1beb0 100644
--- a/system/op_test.go
+++ b/system/op_test.go
@@ -37,15 +37,17 @@ func TestTypeString(t *testing.T) {
{system.EX11, system.EX11.String()},
{system.EDBus, system.EDBus.String()},
{system.EPulse, system.EPulse.String()},
- {system.User, "User"},
- {system.Process, "Process"},
+ {system.User, "user"},
+ {system.Process, "process"},
+ {system.User | system.Process, "user, process"},
+ {system.EWayland | system.User | system.Process, "wayland, user, process"},
+ {system.EX11 | system.Process, "x11, process"},
}
for _, tc := range testCases {
t.Run("label type string "+tc.want, func(t *testing.T) {
if got := system.TypeString(tc.e); got != tc.want {
- t.Errorf("TypeString(%d) = %v, want %v",
- tc.e,
+ t.Errorf("TypeString: %q, want %q",
got, tc.want)
}
})