1
0
mirror of https://github.com/gofiber/fiber.git synced 2025-02-25 16:43:39 +00:00

🧹 Cleanup test files (#348)

🧹 Cleanup test files
This commit is contained in:
Fenny 2020-05-07 22:53:06 +02:00 committed by GitHub
commit 1c9a28e264
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 498 additions and 765 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,11 +10,33 @@ import (
"hash/crc32"
"net"
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"testing"
"time"
"unsafe"
)
// AssertEqual checks if values are equal
func assertEqual(t testing.TB, a interface{}, b interface{}, message ...string) {
if reflect.DeepEqual(a, b) {
return
}
_, file, line, _ := runtime.Caller(1)
msg := fmt.Sprintf(`
Test: %s
Trace: %s:%d
Error: Not equal
Expect: %v [%s]
Result: %v [%s]`, t.Name(), filepath.Base(file), line, a, reflect.TypeOf(a).Name(), b, reflect.TypeOf(b).Name())
if len(message) > 0 {
msg += "\n Message: " + message[0]
}
t.Fatal(msg)
}
// Generate and set ETag header to response
func setETag(ctx *Ctx, weak bool) {
body := ctx.Fasthttp.Response.Body()