Skip to content
This repository was archived by the owner on Sep 7, 2021. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Commit fa23a97

Browse files
authored
PingContext test (#1103)
1 parent 1261905 commit fa23a97

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

context_test.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,19 @@
77
package xorm
88

99
import (
10+
"context"
1011
"testing"
12+
"time"
1113

1214
"github.com/stretchr/testify/assert"
1315
)
1416

1517
func TestPingContext(t *testing.T) {
1618
assert.NoError(t, prepareEngine())
1719

18-
// TODO: Since EngineInterface should be compitable with old Go version, PingContext is not supported.
19-
/*
20-
ctx, _ := context.WithTimeout(context.Background(), 10*time.Second)
21-
err := testEngine.PingContext(ctx)
22-
assert.NoError(t, err)
23-
*/
20+
ctx, canceled := context.WithTimeout(context.Background(), 10*time.Second)
21+
defer canceled()
22+
23+
err := testEngine.(*Engine).PingContext(ctx)
24+
assert.NoError(t, err)
2425
}

0 commit comments

Comments
 (0)