File: 0002-sort-map-to-slice-result.patch

package info (click to toggle)
golang-github-jesseduffield-generics 0.0~git20250517.b0b4a53-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 204 kB
  • sloc: makefile: 2
file content (27 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From: Maytham Alsudany <maytham@debian.org>
Forwarded: not-needed
Description: Sort MapToSlice result
 Test was causing intermittent failures; sometimes it was in the right order,
 sometimes it wasn't.

--- a/maps/maps_test.go
+++ b/maps/maps_test.go
@@ -3,6 +3,7 @@
 import (
 	"fmt"
 	"testing"
+	"slices"
 
 	"github.com/jesseduffield/generics/internal/testutils"
 )
@@ -100,7 +101,9 @@
 		},
 	}
 	for _, test := range tests {
-		testutils.ExpectSlice(t, test.expected, MapToSlice(test.hashMap, test.f))
+		result := MapToSlice(test.hashMap, test.f)
+		slices.Sort(result)
+		testutils.ExpectSlice(t, test.expected, result)
 	}
 }