This commit is contained in:
2023-07-18 13:34:54 +02:00
parent c320bb3d90
commit 710c257c64
4 changed files with 293 additions and 12 deletions

View File

@@ -2,6 +2,7 @@ package tst
import (
"encoding/hex"
"runtime/debug"
"testing"
)
@@ -54,12 +55,18 @@ func AssertHexEqual(t *testing.T, expected string, actual []byte) {
func AssertTrue(t *testing.T, value bool) {
if !value {
t.Error("value should be true")
t.Error("value should be true\n" + string(debug.Stack()))
}
}
func AssertFalse(t *testing.T, value bool) {
if value {
t.Error("value should be false")
t.Error("value should be false\n" + string(debug.Stack()))
}
}
func AssertNoErr(t *testing.T, anerr error) {
if anerr != nil {
t.Error("Function returned an error: " + anerr.Error() + "\n" + string(debug.Stack()))
}
}