Return subscription from channel-preview [skip-tests]
This commit is contained in:
@@ -306,6 +306,22 @@ func AssertAny(v any) {
|
||||
// used to prevent golang "unused variable error"
|
||||
}
|
||||
|
||||
func AssertNil(t *testing.T, key string, v any) {
|
||||
if v != nil {
|
||||
t.Errorf("AssertNil(%s) failed - actual value:\n%+v", key, v)
|
||||
t.Error(string(debug.Stack()))
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func AssertNotNil(t *testing.T, key string, v any) {
|
||||
if v == nil {
|
||||
t.Errorf("AssertNotNil(%s) failed", key)
|
||||
t.Error(string(debug.Stack()))
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func unpointer(v any) any {
|
||||
if v == nil {
|
||||
return v
|
||||
|
||||
Reference in New Issue
Block a user