Files
presenter/error_test.go
T
argoyle 44464c0a85
presenter / test (pull_request) Successful in 2m3s
presenter / vulnerabilities (pull_request) Successful in 2m28s
fix: update module path from gitlab to git.unbound.se
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.
2026-01-09 09:26:03 +01:00

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