HEAVY: finish music service migration, tidy up services, more tests

This commit is contained in:
ari melody 2026-08-01 00:29:31 +01:00
parent 9e311df462
commit 90a671982c
Signed by: ari
GPG key ID: CF99829C92678188
47 changed files with 2698 additions and 902 deletions

26
errors/validation_test.go Normal file
View file

@ -0,0 +1,26 @@
package errors_test
import (
"arimelody-web/errors"
goErrors "errors"
"testing"
"gotest.tools/v3/assert"
)
func Test_ValidationError(t *testing.T) {
var err error
message := "invalid input"
t.Run("can create error", func(t *testing.T) {
err = errors.NewValidationError(message)
assert.Error(t, err, message)
})
t.Run("validator returns true for valid error", func(t *testing.T) {
assert.Equal(t, errors.IsValidationError(err), true)
})
t.Run("validator returns false for invalid error", func(t *testing.T) {
assert.Equal(t, errors.IsValidationError(goErrors.New("other error")), false)
})
}