github.com/TeaOSLab/EdgeNode@v1.3.8/internal/errors/error_test.go (about) 1 package errors 2 3 import ( 4 "errors" 5 "testing" 6 ) 7 8 func TestNew(t *testing.T) { 9 t.Log(New("hello")) 10 t.Log(Wrap(errors.New("hello"))) 11 t.Log(testError1()) 12 t.Log(Wrap(testError1())) 13 t.Log(Wrap(testError2())) 14 } 15 16 func testError1() error { 17 return New("test error1") 18 } 19 20 func testError2() error { 21 return Wrap(testError1()) 22 }