forked from mattermost/mattermost
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modeltestlib.go
51 lines (43 loc) · 1005 Bytes
/
modeltestlib.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package model
import (
"runtime/debug"
"testing"
)
func CheckInt(t *testing.T, got int, expected int) {
if got != expected {
debug.PrintStack()
t.Fatalf("Got: %v, Expected: %v", got, expected)
}
}
func CheckInt64(t *testing.T, got int64, expected int64) {
if got != expected {
debug.PrintStack()
t.Fatalf("Got: %v, Expected: %v", got, expected)
}
}
func CheckString(t *testing.T, got string, expected string) {
if got != expected {
debug.PrintStack()
t.Fatalf("Got: %v, Expected: %v", got, expected)
}
}
func CheckTrue(t *testing.T, test bool) {
if !test {
debug.PrintStack()
t.Fatal("Expected true")
}
}
func CheckFalse(t *testing.T, test bool) {
if test {
debug.PrintStack()
t.Fatal("Expected true")
}
}
func CheckBool(t *testing.T, got bool, expected bool) {
if got != expected {
debug.PrintStack()
t.Fatalf("Got: %v, Expected: %v", got, expected)
}
}