package assert import ( "slices" "testing" ) // Eq fails the test if got != want. func Eq[T comparable](t *testing.T, got, want T) { t.Helper() if got != want { t.Errorf("got %v, want %v", got, want) } } // Contains fails the test if slice does not contain want. func Contains[T comparable](t *testing.T, slice []T, want T) { t.Helper() if !slices.Contains(slice, want) { t.Errorf("slice %v does not contain %v", slice, want) } } // Ok fails the test if err is not nil. func Ok(t *testing.T, err error) { t.Helper() if err != nil { t.Fatalf("unexpected error: %v", err) } }