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

Function TestString_FromSlice

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

Source from the content-addressed store, hash-verified

93}
94
95func TestString_FromSlice(t *testing.T) {
96 slice := []string{"val0", "val1", "val2", "val3", "val4"}
97 set := StringFromSlice(slice)
98
99 if len(set) != len(slice) {
100 t.Fatalf("length mismatch: expected %d, got %d", len(slice), len(set))
101 }
102
103 for _, v := range slice {
104 if _, ok := set[v]; !ok {
105 t.Fatalf("missing key: %v", v)
106 }
107 }
108}
109
110func TestString_NilHandling(t *testing.T) {
111 var nilSet String

Callers

nothing calls this directly

Calls 1

StringFromSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…