mirror of
https://github.com/shirou/gopsutil.git
synced 2025-04-28 13:48:49 +08:00
use legacy error check in the common.TestSleep
This commit is contained in:
parent
34df4904f6
commit
baf3495197
@ -2,7 +2,6 @@ package common_test
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -14,7 +13,7 @@ func TestSleep(test *testing.T) {
|
|||||||
var t = func(name string, ctx context.Context, expected error) {
|
var t = func(name string, ctx context.Context, expected error) {
|
||||||
test.Run(name, func(test *testing.T) {
|
test.Run(name, func(test *testing.T) {
|
||||||
var err = common.Sleep(ctx, dt)
|
var err = common.Sleep(ctx, dt)
|
||||||
if !errors.Is(err, expected) {
|
if err != expected {
|
||||||
test.Errorf("expected %v, got %v", expected, err)
|
test.Errorf("expected %v, got %v", expected, err)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user