mirror of
https://github.com/snowykami/neo-blog.git
synced 2025-09-04 08:16:24 +00:00
⚡ implement email verification feature, add captcha validation middleware, and enhance user authentication flow
This commit is contained in:
19
pkg/errs/errors_test.go
Normal file
19
pkg/errs/errors_test.go
Normal file
@ -0,0 +1,19 @@
|
||||
package errs
|
||||
|
||||
import (
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestAsServiceError(c) {
|
||||
serviceError := ErrNotFound
|
||||
err := AsServiceError(serviceError)
|
||||
if err.Code != serviceError.Code || err.Message != serviceError.Message {
|
||||
t.Errorf("Expected %v, got %v", serviceError, err)
|
||||
}
|
||||
|
||||
serviceError = New(520, "Custom error", nil)
|
||||
err = AsServiceError(serviceError)
|
||||
if err.Code != serviceError.Code || err.Message != serviceError.Message {
|
||||
t.Errorf("Expected %v, got %v", serviceError, err)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user