mirror of
https://github.com/zrepl/zrepl.git
synced 2024-12-23 07:28:57 +01:00
platformtest: harness: fix FailNow (harness wouldn't detect FailNow)
(harness checks for recover() != nil)
This commit is contained in:
parent
93ccdb8024
commit
e7aa08564b
@ -2,6 +2,7 @@ package platformtest
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
@ -12,6 +13,8 @@ type Context struct {
|
|||||||
RootDataset string
|
RootDataset string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var FailNowSentinel = fmt.Errorf("platformtest: FailNow called on context")
|
||||||
|
|
||||||
var _ assert.TestingT = (*Context)(nil)
|
var _ assert.TestingT = (*Context)(nil)
|
||||||
var _ require.TestingT = (*Context)(nil)
|
var _ require.TestingT = (*Context)(nil)
|
||||||
|
|
||||||
@ -20,5 +23,5 @@ func (c *Context) Errorf(format string, args ...interface{}) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (c *Context) FailNow() {
|
func (c *Context) FailNow() {
|
||||||
panic(nil)
|
panic(FailNowSentinel)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user