mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-18 08:00:01 +02:00
Add testifylint to lint checks (#4535)
go-require lint is ignored for now Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4535 Reviewed-by: Gusted <gusted@noreply.codeberg.org> Co-authored-by: TheFox0x7 <thefox0x7@gmail.com> Co-committed-by: TheFox0x7 <thefox0x7@gmail.com>
This commit is contained in:
parent
94933470cd
commit
4de909747b
504 changed files with 5028 additions and 4680 deletions
|
@ -12,6 +12,7 @@ import (
|
|||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -62,7 +63,7 @@ func TestParsePackage(t *testing.T) {
|
|||
|
||||
p, err := ParsePackage(buf, buf.Size())
|
||||
assert.Nil(t, p)
|
||||
assert.ErrorIs(t, err, ErrMissingDescriptionFile)
|
||||
require.ErrorIs(t, err, ErrMissingDescriptionFile)
|
||||
})
|
||||
|
||||
t.Run("Valid", func(t *testing.T) {
|
||||
|
@ -74,7 +75,7 @@ func TestParsePackage(t *testing.T) {
|
|||
p, err := ParsePackage(buf, buf.Size())
|
||||
|
||||
assert.NotNil(t, p)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, packageName, p.Name)
|
||||
assert.Equal(t, packageVersion, p.Version)
|
||||
|
@ -99,7 +100,7 @@ func TestParsePackage(t *testing.T) {
|
|||
|
||||
p, err := ParsePackage(buf, buf.Size())
|
||||
assert.Nil(t, p)
|
||||
assert.ErrorIs(t, err, ErrMissingDescriptionFile)
|
||||
require.ErrorIs(t, err, ErrMissingDescriptionFile)
|
||||
})
|
||||
|
||||
t.Run("Valid", func(t *testing.T) {
|
||||
|
@ -110,7 +111,7 @@ func TestParsePackage(t *testing.T) {
|
|||
|
||||
p, err := ParsePackage(buf, buf.Size())
|
||||
assert.NotNil(t, p)
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.Equal(t, packageName, p.Name)
|
||||
assert.Equal(t, packageVersion, p.Version)
|
||||
|
@ -123,7 +124,7 @@ func TestParseDescription(t *testing.T) {
|
|||
for _, name := range []string{"123abc", "ab-cd", "ab cd", "ab/cd"} {
|
||||
p, err := ParseDescription(createDescription(name, packageVersion))
|
||||
assert.Nil(t, p)
|
||||
assert.ErrorIs(t, err, ErrInvalidName)
|
||||
require.ErrorIs(t, err, ErrInvalidName)
|
||||
}
|
||||
})
|
||||
|
||||
|
@ -131,13 +132,13 @@ func TestParseDescription(t *testing.T) {
|
|||
for _, version := range []string{"1", "1 0", "1.2.3.4.5", "1-2-3-4-5", "1.", "1.0.", "1-", "1-0-"} {
|
||||
p, err := ParseDescription(createDescription(packageName, version))
|
||||
assert.Nil(t, p)
|
||||
assert.ErrorIs(t, err, ErrInvalidVersion)
|
||||
require.ErrorIs(t, err, ErrInvalidVersion)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("Valid", func(t *testing.T) {
|
||||
p, err := ParseDescription(createDescription(packageName, packageVersion))
|
||||
assert.NoError(t, err)
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, p)
|
||||
|
||||
assert.Equal(t, packageName, p.Name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue