Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gosqlite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gosqlite
Commits
9d038bfc
Commit
9d038bfc
authored
Mar 02, 2014
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve tests.
parent
1ff00bd8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
csv_test.go
csv_test.go
+4
-1
example_test.go
example_test.go
+2
-1
No files found.
csv_test.go
View file @
9d038bfc
...
...
@@ -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"
)
...
...
example_test.go
View file @
9d038bfc
...
...
@@ -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
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment