MCPcopy
hub / github.com/tinylib/msgp / TestStringSorted_FromSlice

Function TestStringSorted_FromSlice

msgp/setof/generated_test.go:288–301  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

286}
287
288func TestStringSorted_FromSlice(t *testing.T) {
289 slice := []string{"val0", "val1", "val2", "val3", "val4"}
290 set := StringSortedFromSlice(slice)
291
292 if len(set) != len(slice) {
293 t.Fatalf("length mismatch: expected %d, got %d", len(slice), len(set))
294 }
295
296 for _, v := range slice {
297 if _, ok := set[v]; !ok {
298 t.Fatalf("missing key: %v", v)
299 }
300 }
301}
302
303func TestStringSorted_NilHandling(t *testing.T) {
304 var nilSet StringSorted

Callers

nothing calls this directly

Calls 1

StringSortedFromSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…