Commit 9d038bfc authored by gwenn's avatar gwenn

Improve tests.

parent 1ff00bd8
......@@ -8,6 +8,7 @@ package sqlite_test
import (
"fmt"
"os"
"testing"
. "github.com/gwenn/gosqlite"
)
......@@ -24,13 +25,15 @@ func TestCsvModule(t *testing.T) {
checkNoError(t, err, "couldn't select from CSV virtual table: %s")
defer checkFinalize(s, t)
w, err := os.Open(os.DevNull)
checkNoError(t, err, "couldn't open /dev/null: %s")
var i int
var col1, col2, col3 string
err = s.Select(func(s *Stmt) (err error) {
if err = s.Scan(&i, &col1, &col2, &col3); err != nil {
return
}
fmt.Printf("%d: %s|%s|%s\n", i, col1, col2, col3)
fmt.Fprintf(w, "%d: %s|%s|%s\n", i, col1, col2, col3)
return
})
checkNoError(t, err, "couldn't select from CSV virtual table: %s")
......
......@@ -6,6 +6,7 @@ package sqlite_test
import (
"fmt"
"log"
"sync"
"github.com/gwenn/gosqlite"
......@@ -13,7 +14,7 @@ import (
func check(err error) {
if err != nil {
panic(err)
log.Fatal(err)
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment