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

Function TestInt_FromSlice

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

Source from the content-addressed store, hash-verified

753}
754
755func TestInt_FromSlice(t *testing.T) {
756 slice := []int{0, 1, 2, 3, 4}
757 set := IntFromSlice(slice)
758
759 if len(set) != len(slice) {
760 t.Fatalf("length mismatch: expected %d, got %d", len(slice), len(set))
761 }
762
763 for _, v := range slice {
764 if _, ok := set[v]; !ok {
765 t.Fatalf("missing key: %v", v)
766 }
767 }
768}
769
770func TestInt_NilHandling(t *testing.T) {
771 var nilSet Int

Callers

nothing calls this directly

Calls 1

IntFromSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…