Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
8c039bc4
Commit
8c039bc4
authored
Jan 30, 2011
by
Steven Ashley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a test for error handling in Statement::fetchAll.
parent
937902dc
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
test-statement-fetchall.js
tests/test-statement-fetchall.js
+24
-0
No files found.
tests/test-statement-fetchall.js
View file @
8c039bc4
...
...
@@ -92,6 +92,30 @@ var tests = [
});
});
});
},
'check errors are generated correctly'
:
function
(
assert
,
finished
)
{
var
self
=
this
;
self
.
db
.
open
(
':memory:'
,
function
(
error
)
{
if
(
error
)
throw
error
;
execSQL
(
"CREATE TABLE table2 (value INTEGER, CHECK (value BETWEEN 0 AND 11))"
,
function
(
error
)
{
if
(
error
)
throw
error
;
execSQL
(
"INSERT INTO table2 (value) VALUES (12)"
,
function
(
error
)
{
assert
.
equal
(
error
.
message
,
"constraint failed"
);
finished
();
});
});
});
function
execSQL
(
sql
,
cb
)
{
self
.
db
.
prepare
(
sql
,
function
(
err
,
stmt
)
{
if
(
err
)
throw
err
;
stmt
.
fetchAll
(
function
(
err
,
rows
)
{
stmt
.
finalize
(
function
()
{
cb
(
err
,
rows
);
});
});
});
}
}
}
];
...
...
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