mirror of
https://github.com/safing/portbase
synced 2025-09-09 13:55:47 +00:00
Fix tests and linter warnings
This commit is contained in:
parent
7d2cd6c15d
commit
f59ad0357a
162 changed files with 668 additions and 696 deletions
|
@ -13,7 +13,7 @@ var (
|
|||
errTest = errors.New("test error")
|
||||
)
|
||||
|
||||
func TestWorker(t *testing.T) {
|
||||
func TestWorker(t *testing.T) { //nolint:paralleltest // Too much interference expected.
|
||||
// test basic functionality
|
||||
err := wModule.RunWorker("test worker", func(ctx context.Context) error {
|
||||
return nil
|
||||
|
@ -26,7 +26,7 @@ func TestWorker(t *testing.T) {
|
|||
err = wModule.RunWorker("test worker", func(ctx context.Context) error {
|
||||
return errTest
|
||||
})
|
||||
if err != errTest {
|
||||
if !errors.Is(err, errTest) {
|
||||
t.Errorf("worker failed with unexpected error: %s", err)
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ func TestWorker(t *testing.T) {
|
|||
// test panic recovery
|
||||
err = wModule.RunWorker("test worker", func(ctx context.Context) error {
|
||||
var a []byte
|
||||
_ = a[0] //nolint // we want to runtime panic!
|
||||
_ = a[0]
|
||||
return nil
|
||||
})
|
||||
t.Logf("panic error message: %s", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue