You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
v2ray-core/common/errors/errors_test.go

24 lines
380 B

package errors_test
import (
"testing"
"github.com/v2ray/v2ray-core/common/errors"
"github.com/v2ray/v2ray-core/testing/unit"
)
type MockError struct {
errors.ErrorCode
}
func (err MockError) Error() string {
return "This is a fake error."
}
func TestHasCode(t *testing.T) {
assert := unit.Assert(t)
err := MockError{ErrorCode: 101}
assert.Error(err).HasCode(101)
}