(t *testing.T)
| 206 | } |
| 207 | |
| 208 | func TestValues(t *testing.T) { |
| 209 | data := map[string]int{ |
| 210 | "a": 1, |
| 211 | "b": 2, |
| 212 | } |
| 213 | |
| 214 | values := store.New(data).Values() |
| 215 | |
| 216 | expected := []int{1, 2} |
| 217 | |
| 218 | if len(values) != len(expected) { |
| 219 | t.Fatalf("Expected %d values, got %d", len(expected), len(values)) |
| 220 | } |
| 221 | |
| 222 | for _, v := range expected { |
| 223 | if !slices.Contains(values, v) { |
| 224 | t.Fatalf("Missing value %v in\n%v", v, values) |
| 225 | } |
| 226 | } |
| 227 | } |
| 228 | |
| 229 | func TestSet(t *testing.T) { |
| 230 | s := store.Store[string, int]{} |