mirror of
https://github.com/dolthub/dolt.git
synced 2026-01-31 12:19:08 -06:00
29 lines
580 B
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...)})
|
|
}
|