File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ test("simple query interface", function() {
66
77 var query = client . query ( "select name from person" ) ;
88
9+ client . on ( 'drain' , client . end . bind ( client ) ) ;
10+
911 var rows = [ ] ;
1012 query . on ( 'row' , function ( row ) {
1113 rows . push ( row . fields [ 0 ] )
@@ -19,8 +21,20 @@ test("simple query interface", function() {
1921 assert . equal ( rows [ 0 ] , "Aaron" ) ;
2022 assert . equal ( rows [ 25 ] , "Zanzabar" ) ;
2123 } ) ;
22- client . end ( ) ;
2324 } ) ;
25+ } ) ;
2426
27+ test ( "multiple simple queries" , function ( ) {
28+ var client = helper . client ( ) ;
29+ client . query ( "create temp table bang(id serial, name varchar(5));insert into bang(name) VALUES('boom');" )
30+ client . query ( "insert into bang(name) VALUES ('yes');" ) ;
31+ var query = client . query ( "select name from bang" ) ;
32+ assert . raises ( query , 'row' , function ( row ) {
33+ assert . equal ( row . fields [ 0 ] , 'boom' ) ;
34+ assert . raises ( query , 'row' , function ( row ) {
35+ assert . equal ( row . fields [ 0 ] , 'yes' ) ;
36+ } ) ;
37+ } ) ;
38+ client . on ( 'drain' , client . end . bind ( client ) ) ;
2539} ) ;
2640
You can’t perform that action at this time.
0 commit comments