Tests[SendWithTimestamp, SendInvalidTimestamp]

This commit is contained in:
2022-11-30 22:29:12 +01:00
parent e0ecd4d9ff
commit 7eab74e65c
8 changed files with 209 additions and 10 deletions

View File

@@ -133,19 +133,28 @@ func AssertNotStrRepEqual(t *testing.T, key string, expected any, actual any) {
func TestFail(t *testing.T, msg string) {
t.Error(msg)
t.Error(string(debug.Stack()))
t.FailNow()
}
func TestFailFmt(t *testing.T, format string, args ...any) {
t.Errorf(format, args...)
t.Error(string(debug.Stack()))
t.FailNow()
}
func TestFailErr(t *testing.T, e error) {
t.Error(fmt.Sprintf("Failed with error:\n%s\n\nError:\n%+v\n\nTrace:\n%s", e.Error(), e, string(debug.Stack())))
t.Error(string(debug.Stack()))
t.FailNow()
}
func TestFailIfErr(t *testing.T, e error) {
if e != nil {
TestFailErr(t, e)
}
}
func unpointer(v any) any {
if v == nil {
return v

View File

@@ -224,7 +224,9 @@ func RequestAuthAnyShouldFail(t *testing.T, akey string, method string, baseURL
fmt.Println("")
fmt.Printf("---------------- RESPONSE (%d) ----------------\n", resp.StatusCode)
fmt.Println(langext.TryPrettyPrintJson(string(respBodyBin)))
//TryPrintTraceObj("---------------- -------- ----------------", respBodyBin, "")
if resp.StatusCode != statusCode {
TryPrintTraceObj("---------------- -------- ----------------", respBodyBin, "")
}
fmt.Println("---------------- -------- ----------------")
fmt.Println("")