1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-28 23:06:14 -04:00
v2fly/common/errors/errors_test.go

24 lines
380 B
Go

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)
}