mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
24 lines
383 B
Go
24 lines
383 B
Go
package eval
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
"github.com/elves/elvish/pkg/tt"
|
|
)
|
|
|
|
func TestCause(t *testing.T) {
|
|
err := errors.New("ordinary error")
|
|
exc := &Exception{Cause: err}
|
|
tt.Test(t, tt.Fn("Cause", Cause), tt.Table{
|
|
tt.Args(err).Rets(err),
|
|
tt.Args(exc).Rets(err),
|
|
})
|
|
}
|
|
|
|
func TestException(t *testing.T) {
|
|
Test(t,
|
|
That("kind-of ?(fail foo)").Puts("exception"),
|
|
)
|
|
}
|