mirror of
https://github.com/gogs/gogs.git
synced 2026-02-19 04:47:05 +01:00
Co-authored-by: JSS <jss@unknwon.dev> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
26 lines
428 B
Go
26 lines
428 B
Go
package osx
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
|
|
"gogs.io/gogs/internal/errx"
|
|
)
|
|
|
|
func TestError_NotFound(t *testing.T) {
|
|
tests := []struct {
|
|
err error
|
|
expVal bool
|
|
}{
|
|
{err: os.ErrNotExist, expVal: true},
|
|
{err: os.ErrClosed, expVal: false},
|
|
}
|
|
for _, test := range tests {
|
|
t.Run("", func(t *testing.T) {
|
|
assert.Equal(t, test.expVal, errx.IsNotFound(NewError(test.err)))
|
|
})
|
|
}
|
|
}
|