Files
dolt/d/check.go

29 lines
580 B
Go

package d
import (
"fmt"
"github.com/attic-labs/noms/Godeps/_workspace/src/github.com/stretchr/testify/assert"
)
var (
Chk = assert.New(&panicker{})
// Exp provides the same API as Chk, but the resulting panics can be caught by d.Try()
Exp = assert.New(&recoverablePanicker{})
)
type panicker struct {
}
func (s panicker) Errorf(format string, args ...interface{}) {
panic(fmt.Sprintf(format, args...))
}
type recoverablePanicker struct {
}
func (s recoverablePanicker) Errorf(format string, args ...interface{}) {
panic(UsageError{fmt.Sprintf(format, args...)})
}