Skip to content

Commit 3806c1c

Browse files
committed
Test tweaks.
1 parent 1660c41 commit 3806c1c

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

ext/blobio/blob_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,10 @@ func Example() {
5858
// Hello BLOB!
5959
}
6060

61-
func init() {
61+
func TestMain(m *testing.M) {
6262
sqlite3.AutoExtension(blobio.Register)
6363
sqlite3.AutoExtension(array.Register)
64+
m.Run()
6465
}
6566

6667
func Test_readblob(t *testing.T) {

ext/bloom/bloom_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import (
1212
_ "github.com/ncruces/go-sqlite3/internal/testcfg"
1313
)
1414

15-
func init() {
15+
func TestMain(m *testing.M) {
1616
sqlite3.AutoExtension(bloom.Register)
17+
m.Run()
1718
}
1819

1920
func TestRegister(t *testing.T) {

ext/csv/csv_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,9 @@ func Example() {
5454
// On Twosday, 1€ = $1.1342
5555
}
5656

57-
func init() {
57+
func TestMain(m *testing.M) {
5858
sqlite3.AutoExtension(csv.Register)
59+
m.Run()
5960
}
6061

6162
func TestRegister(t *testing.T) {

ext/pivot/pivot_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,9 @@ func Example() {
8383
// gamma 80 75 78 80
8484
}
8585

86-
func init() {
86+
func TestMain(m *testing.M) {
8787
sqlite3.AutoExtension(pivot.Register)
88+
m.Run()
8889
}
8990

9091
func TestRegister(t *testing.T) {

ext/statement/stmt_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ func Example() {
4848
// Twosday was 2022-2-22
4949
}
5050

51-
func init() {
51+
func TestMain(m *testing.M) {
5252
sqlite3.AutoExtension(statement.Register)
53+
m.Run()
5354
}
5455

5556
func TestRegister(t *testing.T) {

ext/stats/stats_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import (
1010
_ "github.com/ncruces/go-sqlite3/internal/testcfg"
1111
)
1212

13-
func init() {
13+
func TestMain(m *testing.M) {
1414
sqlite3.AutoExtension(stats.Register)
15+
m.Run()
1516
}
1617

1718
func TestRegister_variance(t *testing.T) {

0 commit comments

Comments
 (0)