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)
| 628 | // matches one or more times in callOrder. This makes it compatible |
| 629 | // with go test flag -count=X where X > 1. |
| 630 | func 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 | |
| 650 | func 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 |
no test coverage detected