MCPcopy
hub / github.com/stretchr/testify / callOrderAssert

Function callOrderAssert

suite/suite_test.go:630–648  ·  view source on GitHub ↗

callOrderAssert is a help with confirms that asserts that expect matches one or more times in callOrder. This makes it compatible with go test flag -count=X where X > 1.

(t *testing.T, expect, callOrder []string)

Source from the content-addressed store, hash-verified

628// matches one or more times in callOrder. This makes it compatible
629// with go test flag -count=X where X > 1.
630func callOrderAssert(t *testing.T, expect, callOrder []string) {
631 var ti interface{} = t
632 if h, ok := ti.(tHelper); ok {
633 h.Helper()
634 }
635
636 callCount := len(callOrder)
637 expectCount := len(expect)
638 if callCount > expectCount && callCount%expectCount == 0 {
639 // Command line flag -count=X where X > 1.
640 for len(callOrder) >= expectCount {
641 assert.Equal(t, expect, callOrder[:expectCount])
642 callOrder = callOrder[expectCount:]
643 }
644 return
645 }
646
647 assert.Equal(t, expect, callOrder)
648}
649
650func TestFailfastSuiteFailFastOn(t *testing.T) {
651 // To test this with failfast on (and isolated from other intended test failures in our test suite) we launch it in its own process

Callers 1

TestFailfastSuiteFunction · 0.85

Calls 2

EqualFunction · 0.92
HelperMethod · 0.65

Tested by

no test coverage detected