mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-23 01:08:47 +02:00
refactor: move task, error and testing utils to separte repo; apply gofumpt
This commit is contained in:
@@ -4,8 +4,8 @@ import (
|
||||
"strconv"
|
||||
"testing"
|
||||
|
||||
"github.com/yusing/godoxy/internal/gperr"
|
||||
. "github.com/yusing/godoxy/internal/utils/testing"
|
||||
gperr "github.com/yusing/goutils/errs"
|
||||
expect "github.com/yusing/goutils/testing"
|
||||
)
|
||||
|
||||
func TestParser(t *testing.T) {
|
||||
@@ -68,15 +68,15 @@ func TestParser(t *testing.T) {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
subject, args, err := parse(tt.input)
|
||||
if tt.wantErr != nil {
|
||||
ExpectError(t, tt.wantErr, err)
|
||||
expect.ErrorIs(t, tt.wantErr, err)
|
||||
return
|
||||
}
|
||||
// t.Log(subject, args, err)
|
||||
ExpectNoError(t, err)
|
||||
ExpectEqual(t, subject, tt.subject)
|
||||
ExpectEqual(t, len(args), len(tt.args))
|
||||
expect.NoError(t, err)
|
||||
expect.Equal(t, subject, tt.subject)
|
||||
expect.Equal(t, len(args), len(tt.args))
|
||||
for i, arg := range args {
|
||||
ExpectEqual(t, arg, tt.args[i])
|
||||
expect.Equal(t, arg, tt.args[i])
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -89,7 +89,7 @@ func TestParser(t *testing.T) {
|
||||
for i, test := range tests {
|
||||
t.Run(strconv.Itoa(i), func(t *testing.T) {
|
||||
_, _, err := parse(test)
|
||||
ExpectError(t, ErrUnterminatedQuotes, err)
|
||||
expect.ErrorIs(t, ErrUnterminatedQuotes, err)
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user