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
5bad8878
Commit
5bad8878
authored
Mar 21, 2013
by
Tom Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure the INSERT completes before trying the SELECT
parent
113c3719
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
other_objects.test.js
test/other_objects.test.js
+12
-4
No files found.
test/other_objects.test.js
View file @
5bad8878
...
...
@@ -17,23 +17,27 @@ describe('data types', function() {
it
(
'should serialize Date()'
,
function
(
done
)
{
var
date
=
new
Date
();
db
.
run
(
"INSERT INTO int_table VALUES(?)"
,
date
);
db
.
run
(
"INSERT INTO int_table VALUES(?)"
,
date
,
function
(
err
)
{
if
(
err
)
throw
err
;
db
.
get
(
"SELECT int FROM int_table"
,
function
(
err
,
row
)
{
if
(
err
)
throw
err
;
assert
.
equal
(
row
.
int
,
+
date
);
done
();
});
});
});
it
(
'should serialize RegExp()'
,
function
(
done
)
{
var
regexp
=
/^f
\n
oo/
;
db
.
run
(
"INSERT INTO txt_table VALUES(?)"
,
regexp
);
db
.
run
(
"INSERT INTO txt_table VALUES(?)"
,
regexp
,
function
(
err
)
{
if
(
err
)
throw
err
;
db
.
get
(
"SELECT txt FROM txt_table"
,
function
(
err
,
row
)
{
if
(
err
)
throw
err
;
assert
.
equal
(
row
.
txt
,
String
(
regexp
));
done
();
});
});
});
[
4294967296.249
,
...
...
@@ -49,7 +53,8 @@ describe('data types', function() {
-
Infinity
].
forEach
(
function
(
flt
)
{
it
(
'should serialize float '
+
flt
,
function
(
done
)
{
db
.
run
(
"INSERT INTO flt_table VALUES(?)"
,
flt
);
db
.
run
(
"INSERT INTO flt_table VALUES(?)"
,
flt
,
function
(
err
)
{
if
(
err
)
throw
err
;
db
.
get
(
"SELECT flt FROM flt_table"
,
function
(
err
,
row
)
{
if
(
err
)
throw
err
;
assert
.
equal
(
row
.
flt
,
flt
);
...
...
@@ -57,6 +62,7 @@ describe('data types', function() {
});
});
});
});
[
4294967299
,
...
...
@@ -70,7 +76,8 @@ describe('data types', function() {
-
Infinity
].
forEach
(
function
(
integer
)
{
it
(
'should serialize integer '
+
integer
,
function
(
done
)
{
db
.
run
(
"INSERT INTO int_table VALUES(?)"
,
integer
);
db
.
run
(
"INSERT INTO int_table VALUES(?)"
,
integer
,
function
(
err
)
{
if
(
err
)
throw
err
;
db
.
get
(
"SELECT int AS integer FROM int_table"
,
function
(
err
,
row
)
{
if
(
err
)
throw
err
;
assert
.
equal
(
row
.
integer
,
integer
);
...
...
@@ -78,4 +85,5 @@ describe('data types', function() {
});
});
});
});
});
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