0
0
mirror of https://gitlab.com/cznic/sqlite.git synced 2025-04-27 23:07:44 +00:00
Files
go-sqlite/cgo_test.go
2022-08-25 09:38:46 +00:00

37 lines
753 B
Go

// Copyright 2017 The Sqlite Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build ignore || (cgo && cgotest)
// +build ignore cgo,cgotest
package sqlite // import "modernc.org/sqlite"
import (
"database/sql"
"os"
"path/filepath"
"testing"
_ "github.com/mattn/go-sqlite3"
)
// https://gitlab.com/cznic/sqlite/-/issues/65
func TestIssue65CGo(t *testing.T) {
tempDir, err := os.MkdirTemp("", "")
if err != nil {
t.Fatal(err)
}
defer func() {
os.RemoveAll(tempDir)
}()
db, err := sql.Open("sqlite3", filepath.Join(tempDir, "testissue65.sqlite"))
if err != nil {
t.Fatalf("Failed to open database: %v", err)
}
testIssue65(t, db, false)
}