mirror of
https://github.com/zrepl/zrepl.git
synced 2024-12-22 15:11:16 +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 (
|
||||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
@ -12,6 +13,8 @@ type Context struct {
|
||||
RootDataset string
|
||||
}
|
||||
|
||||
var FailNowSentinel = fmt.Errorf("platformtest: FailNow called on context")
|
||||
|
||||
var _ assert.TestingT = (*Context)(nil)
|
||||
var _ require.TestingT = (*Context)(nil)
|
||||
|
||||
@ -20,5 +23,5 @@ func (c *Context) Errorf(format string, args ...interface{}) {
|
||||
}
|
||||
|
||||
func (c *Context) FailNow() {
|
||||
panic(nil)
|
||||
panic(FailNowSentinel)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user