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
|
package gopter_test
import (
"testing"
"github.com/leanovate/gopter"
)
func TestTestResult(t *testing.T) {
result := &gopter.TestResult{Status: gopter.TestPassed}
if !result.Passed() {
t.Errorf("Test not passed: %#v", result)
}
if result.Status.String() != "PASSED" {
t.Errorf("Invalid status: %#v", result)
}
result = &gopter.TestResult{Status: gopter.TestProved}
if !result.Passed() {
t.Errorf("Test not passed: %#v", result)
}
if result.Status.String() != "PROVED" {
t.Errorf("Invalid status: %#v", result)
}
result = &gopter.TestResult{Status: gopter.TestFailed}
if result.Passed() {
t.Errorf("Test passed: %#v", result)
}
if result.Status.String() != "FAILED" {
t.Errorf("Invalid status: %#v", result)
}
result = &gopter.TestResult{Status: gopter.TestExhausted}
if result.Passed() {
t.Errorf("Test passed: %#v", result)
}
if result.Status.String() != "EXHAUSTED" {
t.Errorf("Invalid status: %#v", result)
}
result = &gopter.TestResult{Status: gopter.TestError}
if result.Passed() {
t.Errorf("Test passed: %#v", result)
}
if result.Status.String() != "ERROR" {
t.Errorf("Invalid status: %#v", result)
}
}
|