fixes time.Duration zero formatted value matching
Этот коммит содержится в:
родитель
df5310a062
коммит
b41f349e3c
1 изменённых файлов: 12 добавлений и 10 удалений
|
@ -7,6 +7,7 @@ import (
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/DATA-DOG/godog/colors"
|
"github.com/DATA-DOG/godog/colors"
|
||||||
"github.com/DATA-DOG/godog/gherkin"
|
"github.com/DATA-DOG/godog/gherkin"
|
||||||
|
@ -69,30 +70,31 @@ func TestJUnitSimpleFeature(t *testing.T) {
|
||||||
s.Step(`^failing$`, func() error { return fmt.Errorf("errored") })
|
s.Step(`^failing$`, func() error { return fmt.Errorf("errored") })
|
||||||
s.Step(`^pending$`, func() error { return ErrPending })
|
s.Step(`^pending$`, func() error { return ErrPending })
|
||||||
|
|
||||||
|
var zeroDuration time.Duration
|
||||||
expected := junitPackageSuite{
|
expected := junitPackageSuite{
|
||||||
Name: "junit",
|
Name: "junit",
|
||||||
Tests: 8,
|
Tests: 8,
|
||||||
Skipped: 0,
|
Skipped: 0,
|
||||||
Failures: 2,
|
Failures: 2,
|
||||||
Errors: 4,
|
Errors: 4,
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
TestSuites: []*junitTestSuite{{
|
TestSuites: []*junitTestSuite{{
|
||||||
Name: "junit formatter",
|
Name: "junit formatter",
|
||||||
Tests: 8,
|
Tests: 8,
|
||||||
Skipped: 0,
|
Skipped: 0,
|
||||||
Failures: 2,
|
Failures: 2,
|
||||||
Errors: 4,
|
Errors: 4,
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
TestCases: []*junitTestCase{
|
TestCases: []*junitTestCase{
|
||||||
{
|
{
|
||||||
Name: "passing scenario",
|
Name: "passing scenario",
|
||||||
Status: "passed",
|
Status: "passed",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "failing scenario",
|
Name: "failing scenario",
|
||||||
Status: "failed",
|
Status: "failed",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
Failure: &junitFailure{
|
Failure: &junitFailure{
|
||||||
Message: "Step failing: errored",
|
Message: "Step failing: errored",
|
||||||
},
|
},
|
||||||
|
@ -103,7 +105,7 @@ func TestJUnitSimpleFeature(t *testing.T) {
|
||||||
{
|
{
|
||||||
Name: "pending scenario",
|
Name: "pending scenario",
|
||||||
Status: "pending",
|
Status: "pending",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
Error: []*junitError{
|
Error: []*junitError{
|
||||||
{Message: "Step pending: TODO: write pending definition", Type: "pending"},
|
{Message: "Step pending: TODO: write pending definition", Type: "pending"},
|
||||||
{Message: "Step passing", Type: "skipped"},
|
{Message: "Step passing", Type: "skipped"},
|
||||||
|
@ -112,7 +114,7 @@ func TestJUnitSimpleFeature(t *testing.T) {
|
||||||
{
|
{
|
||||||
Name: "undefined scenario",
|
Name: "undefined scenario",
|
||||||
Status: "undefined",
|
Status: "undefined",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
Error: []*junitError{
|
Error: []*junitError{
|
||||||
{Message: "Step undefined", Type: "undefined"},
|
{Message: "Step undefined", Type: "undefined"},
|
||||||
{Message: "Step next undefined", Type: "undefined"},
|
{Message: "Step next undefined", Type: "undefined"},
|
||||||
|
@ -121,12 +123,12 @@ func TestJUnitSimpleFeature(t *testing.T) {
|
||||||
{
|
{
|
||||||
Name: "outline #1",
|
Name: "outline #1",
|
||||||
Status: "passed",
|
Status: "passed",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Name: "outline #2",
|
Name: "outline #2",
|
||||||
Status: "failed",
|
Status: "failed",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
Failure: &junitFailure{
|
Failure: &junitFailure{
|
||||||
Message: "Step failing: errored",
|
Message: "Step failing: errored",
|
||||||
},
|
},
|
||||||
|
@ -134,7 +136,7 @@ func TestJUnitSimpleFeature(t *testing.T) {
|
||||||
{
|
{
|
||||||
Name: "outline #3",
|
Name: "outline #3",
|
||||||
Status: "pending",
|
Status: "pending",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
Error: []*junitError{
|
Error: []*junitError{
|
||||||
{Message: "Step pending: TODO: write pending definition", Type: "pending"},
|
{Message: "Step pending: TODO: write pending definition", Type: "pending"},
|
||||||
},
|
},
|
||||||
|
@ -142,7 +144,7 @@ func TestJUnitSimpleFeature(t *testing.T) {
|
||||||
{
|
{
|
||||||
Name: "outline #4",
|
Name: "outline #4",
|
||||||
Status: "undefined",
|
Status: "undefined",
|
||||||
Time: "0s",
|
Time: zeroDuration.String(),
|
||||||
Error: []*junitError{
|
Error: []*junitError{
|
||||||
{Message: "Step undefined", Type: "undefined"},
|
{Message: "Step undefined", Type: "undefined"},
|
||||||
},
|
},
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче