From e08810a12fa47154373a8b568d8a5587e83796fc Mon Sep 17 00:00:00 2001 From: Noah Hsu Date: Mon, 18 Jul 2022 11:37:53 +0800 Subject: [PATCH] chore: fix test typo --- internal/aria2/aria2_test.go | 9 +++++---- internal/db/meta_test.go | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/internal/aria2/aria2_test.go b/internal/aria2/aria2_test.go index 6bdc0dd7072..51499dc7651 100644 --- a/internal/aria2/aria2_test.go +++ b/internal/aria2/aria2_test.go @@ -2,6 +2,10 @@ package aria2 import ( "context" + "path/filepath" + "testing" + "time" + _ "github.com/alist-org/alist/v3/drivers" conf2 "github.com/alist-org/alist/v3/internal/conf" "github.com/alist-org/alist/v3/internal/db" @@ -10,9 +14,6 @@ import ( "github.com/alist-org/alist/v3/pkg/task" "gorm.io/driver/sqlite" "gorm.io/gorm" - "path/filepath" - "testing" - "time" ) func init() { @@ -30,7 +31,7 @@ func init() { } func TestConnect(t *testing.T) { - err := InitAria2Client("http://localhost:16800/jsonrpc", "secret", 3) + _, err := InitAria2Client("http://localhost:16800/jsonrpc", "secret", 3) if err != nil { t.Errorf("failed to init aria2: %+v", err) } diff --git a/internal/db/meta_test.go b/internal/db/meta_test.go index 2202414654b..b3a78b1782f 100644 --- a/internal/db/meta_test.go +++ b/internal/db/meta_test.go @@ -1,6 +1,7 @@ package db import ( + "github.com/alist-org/alist/v3/internal/errs" "github.com/alist-org/alist/v3/internal/model" "github.com/pkg/errors" "gorm.io/driver/sqlite" @@ -51,7 +52,7 @@ func TestGetNearestMeta1(t *testing.T) { func TestGetNearestMeta2(t *testing.T) { meta, err := GetNearestMeta("/c/d/e") - if errors.Cause(err) != ErrMetaNotFound { + if errors.Cause(err) != errs.MetaNotFound { t.Errorf("unexpected error: %+v", err) t.Errorf("unexpected meta: %+v", meta) }