]> git.maquefel.me Git - brevno-suite/hugo/commitdiff
common/maps: Simplify TestScratchSetInMap/DeleteInMap
authorOleksandr Redko <oleksandr.red+github@gmail.com>
Thu, 5 Dec 2024 10:25:13 +0000 (12:25 +0200)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Thu, 5 Dec 2024 11:40:59 +0000 (12:40 +0100)
common/maps/scratch_test.go

index b515adb1d526da85e480b43b5da899de0814ec3a..88fd73f2ba1d00a75d8e2ad918e288931f2fd3e7 100644 (file)
@@ -185,7 +185,7 @@ func TestScratchSetInMap(t *testing.T) {
        scratch.SetInMap("key", "zyx", "Zyx")
        scratch.SetInMap("key", "abc", "Abc (updated)")
        scratch.SetInMap("key", "def", "Def")
-       c.Assert(scratch.GetSortedMapValues("key"), qt.DeepEquals, []any{0: "Abc (updated)", 1: "Def", 2: "Lux", 3: "Zyx"})
+       c.Assert(scratch.GetSortedMapValues("key"), qt.DeepEquals, any([]any{"Abc (updated)", "Def", "Lux", "Zyx"}))
 }
 
 func TestScratchDeleteInMap(t *testing.T) {
@@ -199,7 +199,7 @@ func TestScratchDeleteInMap(t *testing.T) {
        scratch.DeleteInMap("key", "abc")
        scratch.SetInMap("key", "def", "Def")
        scratch.DeleteInMap("key", "lmn") // Do nothing
-       c.Assert(scratch.GetSortedMapValues("key"), qt.DeepEquals, []any{0: "Def", 1: "Lux", 2: "Zyx"})
+       c.Assert(scratch.GetSortedMapValues("key"), qt.DeepEquals, any([]any{"Def", "Lux", "Zyx"}))
 }
 
 func TestScratchGetSortedMapValues(t *testing.T) {