2018-06-13 22:38:18 -07:00
|
|
|
package base
|
2018-06-16 22:14:18 +08:00
|
|
|
|
2018-06-13 22:38:18 -07:00
|
|
|
import (
|
|
|
|
. "github.com/smartystreets/goconvey/convey"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestId3(t *testing.T) {
|
2018-06-16 22:14:18 +08:00
|
|
|
Convey("Doing a error test", t, func() {
|
2018-06-13 22:38:18 -07:00
|
|
|
var _gerr GoLearnError
|
|
|
|
gerr := &_gerr
|
|
|
|
gerr.attachFormattedStack()
|
|
|
|
s := gerr.Error()
|
|
|
|
So(s, ShouldNotBeNil)
|
|
|
|
err := DescribeError("test", nil)
|
|
|
|
So(err, ShouldNotBeNil)
|
|
|
|
err = WrapError(nil)
|
|
|
|
So(err, ShouldNotBeNil)
|
|
|
|
s = wrapLinesWithTabPrefix("123\ntest\n")
|
|
|
|
So(s, ShouldEqual, "\t123\n\ttest\n\t")
|
|
|
|
})
|
|
|
|
}
|