44464c0a85
Change the module path in various files to reflect the new repository location on git.unbound.se. Update imports in CLAUDE.md, error_test.go, and presenter_test.go to ensure compatibility with the updated module path. Remove outdated CI configuration in .pre-commit-config.yaml to streamline the setup. This enhances consistency and aligns the project with its new hosting platform.
25 lines
858 B
Go
25 lines
858 B
Go
package presenter_test
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
|
|
"git.unbound.se/shiny/presenter"
|
|
)
|
|
|
|
func TestCodedError_ErrorIs(t *testing.T) {
|
|
require.True(t, errors.Is(ErrActivityNotFound, ErrActivityNotFound))
|
|
require.False(t, errors.Is(ErrActivityNotFound, fmt.Errorf("other")))
|
|
require.False(t, errors.Is(ErrActivityNotFound, ErrEntryNotFound))
|
|
require.False(t, errors.Is(ErrActivityNotFound, ErrActivityNotFound.WithParam("some", "value")))
|
|
require.False(t, errors.Is(ErrActivityNotFound.WithParam("some", "other"), ErrActivityNotFound.WithParam("some", "value")))
|
|
}
|
|
|
|
var (
|
|
ErrActivityNotFound = presenter.NewCodedError("activity not found", presenter.CodeNotFound, presenter.EntityActivity)
|
|
ErrEntryNotFound = presenter.NewCodedError("entry not found", presenter.CodeNotFound, presenter.EntityEntry)
|
|
)
|