I've been burned a few times by tests that simply fatal, requiring me to
run another build to learn more about what the mismatch was. Avoid this.

This is part of a long running goal of mine to make testing "better".
Этот коммит содержится в:
Jesse Hallam
2018-08-09 05:26:38 -04:00
коммит произвёл Jesús Espino
родитель 0bbabd137b
Коммит d8c8a19d35
18 изменённых файлов: 153 добавлений и 362 удалений

Просмотреть файл

@@ -5,25 +5,20 @@ package model
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestCompliancePostHeader(t *testing.T) {
if CompliancePostHeader()[0] != "TeamName" {
t.Fatal()
}
require.Equal(t, "TeamName", CompliancePostHeader()[0])
}
func TestCompliancePost(t *testing.T) {
o := CompliancePost{TeamName: "test", PostFileIds: "files", PostCreateAt: GetMillis()}
r := o.Row()
if r[0] != "test" {
t.Fatal()
}
if r[len(r)-1] != "files" {
t.Fatal()
}
require.Equal(t, "test", r[0])
require.Equal(t, "files", r[len(r)-1])
}
var cleanTests = []struct {