mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
* Unit Tests for model/push_response.go * Unit tests for security_bulletin.go * Unit tests for webrtc.go * Unit tests for model/password_recovery.go * Add missing headers. * Unit tests for model/license.go * Tidy up existing tests. * Simplify JSON to/from tests. * Fix gofmt
52 lines
1005 B
Go
52 lines
1005 B
Go
// 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)
|
|
}
|
|
}
|