From 5109f19d66b75da025253527af034f53c1a72984 Mon Sep 17 00:00:00 2001 From: diamondburned Date: Sat, 29 Jun 2024 11:40:48 +0700 Subject: [PATCH] Fix core/gioutil tests --- pkg/core/gioutil/listmodel_example_test.go | 4 ++-- pkg/core/gioutil/listmodel_test.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/core/gioutil/listmodel_example_test.go b/pkg/core/gioutil/listmodel_example_test.go index 33550b03f..89857be07 100644 --- a/pkg/core/gioutil/listmodel_example_test.go +++ b/pkg/core/gioutil/listmodel_example_test.go @@ -23,8 +23,8 @@ func ExampleListModel() { list.Append(Person{"Bob", 30}) list.Append(Person{"Charlie", 40}) - // AllItems() can be iterated over if rangefunc is supported. - all := list.AllItems() + // All() can be iterated over if rangefunc is supported. + all := list.All() all(func(p Person) bool { fmt.Println(p) return true diff --git a/pkg/core/gioutil/listmodel_test.go b/pkg/core/gioutil/listmodel_test.go index 794bc054f..b155c1812 100644 --- a/pkg/core/gioutil/listmodel_test.go +++ b/pkg/core/gioutil/listmodel_test.go @@ -35,19 +35,19 @@ func TestListModel(t *testing.T) { fuckShitUp() - listItems := drainIterator(list.AllItems()) + listItems := drainIterator(list.All()) assertEq(t, "ListModel length mismatch", list.NItems(), 3) assertEq(t, "ListModel's items don't match expected list", listItems, expect) list.Remove(0) - listItems = drainIterator(list.AllItems()) + listItems = drainIterator(list.All()) assertEq(t, "ListModel length mismatch", list.NItems(), 2) assertEq(t, "ListModel's items don't match expected list", listItems, expect[1:]) list.Splice(0, 2) - listItems = drainIterator(list.AllItems()) + listItems = drainIterator(list.All()) assertEq(t, "ListModel length mismatch", list.NItems(), 0) assertEq(t, "ListModel's items don't match expected list", listItems, []weirdType(nil)) } @@ -85,7 +85,7 @@ func BenchmarkListModel(b *testing.B) { b.ResetTimer() for i := 0; i < b.N; i++ { - all := list.AllItems() + all := list.All() all(func(*weirdType) bool { return true }) } })