Files
dolt/d/try_test.go
T
Chris Masone df520db380 Use d.Try less granularly
We can still get useful error messages out of d.Try without
specifically wrapping every single thing that might throw a
noms UsageError, so do so. The code is cleaner.

Towards issue #176
2015-08-11 11:25:50 -07:00

23 lines
329 B
Go

package d
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestTry(t *testing.T) {
assert := assert.New(t)
e := Try(func() { Exp.Fail("hey-o") })
assert.IsType(UsageError{}, e)
assert.Panics(func() {
Try(func() { Chk.Fail("hey-o") })
})
assert.Panics(func() {
Try(func() { panic("hey-o") })
})
}