aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/kobject/kobject_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-05-27 17:58:01 +0900
committerOphestra <cat@gensokyo.uk>2026-05-27 17:58:01 +0900
commitb18f40d974ffc33f3703d46bfe42d6fa2f844a01 (patch)
tree1b713d0d797ab99da540d772255009775fe3c1c3 /internal/kobject/kobject_test.go
parent12a606105124d1ef3133594afb9e6e0bc2e0ad33 (diff)
internal/kobject: pass action kind for range
Useful for handling most uevents. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/kobject/kobject_test.go')
-rw-r--r--internal/kobject/kobject_test.go12
1 files changed, 9 insertions, 3 deletions
diff --git a/internal/kobject/kobject_test.go b/internal/kobject/kobject_test.go
index b184e621..c6a54904 100644
--- a/internal/kobject/kobject_test.go
+++ b/internal/kobject/kobject_test.go
@@ -388,7 +388,9 @@ func TestIter(t *testing.T) {
"SEQNUM=1",
}}
synctest.Wait()
- s.Range(t.Context(), func(o *Object) bool { return false })
+ s.Range(t.Context(), func(*Object, uevent.KobjectAction) bool {
+ return false
+ })
var got []*Object
check := func(want []*Object) {
@@ -405,7 +407,7 @@ func TestIter(t *testing.T) {
defer cancel()
var done bool
wg.Go(func() {
- s.Range(ctx, func(o *Object) bool {
+ s.Range(ctx, func(o *Object, _ uevent.KobjectAction) bool {
got = append(got, o.Clone())
return !done
})
@@ -437,7 +439,11 @@ func TestIter(t *testing.T) {
},
})
- wg.Go(func() { s.Range(ctx, func(*Object) bool { return true }) })
+ wg.Go(func() {
+ s.Range(ctx, func(*Object, uevent.KobjectAction) bool {
+ return true
+ })
+ })
synctest.Wait()
iter := reflect.ValueOf(s).Elem().FieldByName("iter")