@@ -543,6 +543,23 @@ describe('async.test.js', function() {
543543 } ) ;
544544
545545 describe ( 'insert(table, row[s])' , function ( ) {
546+ it ( 'should set now() as a default value for `gmt_create` and `gmt_modified`' , async function ( ) {
547+ const result = await this . db . insert ( table , [ {
548+ name : prefix + 'fengmk2-insert00' ,
549+ email : prefix + 'm@fengmk2-insert.com' ,
550+ } , {
551+ name : prefix + 'fengmk2-insert01' ,
552+ email : prefix + 'm@fengmk2-insert.com' ,
553+ gmt_create : this . db . literals . now ,
554+ gmt_modified : this . db . literals . now ,
555+ } ] ) ;
556+ assert . equal ( result . affectedRows , 2 ) ;
557+
558+ const result1 = await this . db . get ( table , { name : prefix + 'fengmk2-insert00' } , { columns : [ 'gmt_create' , 'gmt_modified' ] } ) ;
559+ const result2 = await this . db . get ( table , { name : prefix + 'fengmk2-insert01' } , { columns : [ 'gmt_create' , 'gmt_modified' ] } ) ;
560+ assert . deepEqual ( result1 . gmt_create , result2 . gmt_create ) ;
561+ assert . deepEqual ( result2 . gmt_modified , result2 . gmt_modified ) ;
562+ } ) ;
546563 it ( 'should insert one row' , async function ( ) {
547564 const result = await this . db . insert ( table , {
548565 name : prefix + 'fengmk2-insert1' ,
0 commit comments