Tests[SendWithAdminKey, SendWithSendKey, SendWithReadKey, SendWithPermissionSendKey]
This commit is contained in:
@@ -177,6 +177,24 @@ func AssertTrue(t *testing.T, key string, v bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func AssertNotDefault[T comparable](t *testing.T, key string, v T) {
|
||||
if v == *new(T) {
|
||||
t.Errorf("AssertNotDefault(%s) failed", key)
|
||||
t.Error(ljson(v))
|
||||
t.Error(string(debug.Stack()))
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func AssertNotDefaultAny[T any](t *testing.T, key string, v T) {
|
||||
if ljson(v) == ljson(*new(T)) {
|
||||
t.Errorf("AssertNotDefault(%s) failed", key)
|
||||
t.Error(ljson(v))
|
||||
t.Error(string(debug.Stack()))
|
||||
t.FailNow()
|
||||
}
|
||||
}
|
||||
|
||||
func AssertNotEqual(t *testing.T, key string, expected any, actual any) {
|
||||
if expected == actual || (langext.IsNil(expected) && langext.IsNil(actual)) {
|
||||
t.Errorf("Value [%s] does not differ (%T <-> %T):\n", key, expected, actual)
|
||||
|
||||
@@ -546,6 +546,10 @@ func doAcceptSub(t *testing.T, baseUrl string, user Userdat, subscriber Userdat,
|
||||
|
||||
}
|
||||
|
||||
func LipsumWord(seed int64, wordcount int) string {
|
||||
return loremipsum.NewWithSeed(seed).Words(wordcount)
|
||||
}
|
||||
|
||||
func Lipsum(seed int64, paracount int) string {
|
||||
return loremipsum.NewWithSeed(seed).Paragraphs(paracount)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user