use proper errors for db.Err

- switch to using errors.Is where applicable
This commit is contained in:
2023-11-29 19:52:10 -06:00
parent 18a6c5ab42
commit d0346b2382
3 changed files with 8 additions and 6 deletions

View File

@@ -2,6 +2,7 @@ package db_test
import (
"context"
"errors"
"os"
"testing"
@@ -50,7 +51,7 @@ func TestDBAccount(t *testing.T) {
t.Error("account username is not test")
}
if _, err = testDB.TryLogin("test", "wrongpassword"); err != db.ErrLoginInvalidPassword {
if _, err = testDB.TryLogin("test", "wrongpassword"); !errors.Is(err, db.ErrLoginInvalidPassword) {
t.Error("expected ErrLoginInvalidPassword")
}
}