github.com/rajatvaryani/mattermost-server@v5.11.1+incompatible/model/modeltestlib_test.go (about) 1 // Copyright (c) 2017 Mattermost, Inc. All Rights Reserved. 2 // See License.txt for license information. 3 4 package model 5 6 import ( 7 "runtime/debug" 8 "testing" 9 ) 10 11 func CheckInt(t *testing.T, got int, expected int) { 12 if got != expected { 13 debug.PrintStack() 14 t.Fatalf("Got: %v, Expected: %v", got, expected) 15 } 16 } 17 18 func CheckInt64(t *testing.T, got int64, expected int64) { 19 if got != expected { 20 debug.PrintStack() 21 t.Fatalf("Got: %v, Expected: %v", got, expected) 22 } 23 } 24 25 func CheckString(t *testing.T, got string, expected string) { 26 if got != expected { 27 debug.PrintStack() 28 t.Fatalf("Got: %v, Expected: %v", got, expected) 29 } 30 } 31 32 func CheckTrue(t *testing.T, test bool) { 33 if !test { 34 debug.PrintStack() 35 t.Fatal("Expected true") 36 } 37 } 38 39 func CheckFalse(t *testing.T, test bool) { 40 if test { 41 debug.PrintStack() 42 t.Fatal("Expected true") 43 } 44 } 45 46 func CheckBool(t *testing.T, got bool, expected bool) { 47 if got != expected { 48 debug.PrintStack() 49 t.Fatalf("Got: %v, Expected: %v", got, expected) 50 } 51 }