@@ -68,32 +68,24 @@ function defineTypeTest(name, fields, testRows, customTest) {
6868 }
6969 } ;
7070
71- expectEvents (
72- test ,
73- eventLog ,
74- [
75- expectedWrite
76- ] ,
77- testRows . length ,
78- ( ) => {
79- test . equal ( errorLog . length , 0 ) ;
71+ expectEvents ( test , eventLog , [ expectedWrite ] , testRows . length , ( ) => {
72+ test . equal ( errorLog . length , 0 ) ;
8073
81- const binlogRows = eventLog . reduce ( ( prev , curr ) => {
82- if ( curr . getTypeName ( ) === 'WriteRows' ) {
83- prev = prev . concat ( curr . rows ) ;
84- }
85- return prev ;
86- } , [ ] ) ;
87-
88- if ( customTest ) {
89- customTest . bind ( selectResult ) ( test , { rows : binlogRows } ) ;
90- } else {
91- assert . deepEqual ( selectResult , binlogRows ) ;
74+ const binlogRows = eventLog . reduce ( ( prev , curr ) => {
75+ if ( curr . getTypeName ( ) === 'WriteRows' ) {
76+ prev = prev . concat ( curr . rows ) ;
9277 }
78+ return prev ;
79+ } , [ ] ) ;
9380
94- test . end ( ) ;
81+ if ( customTest ) {
82+ customTest . bind ( selectResult ) ( test , { rows : binlogRows } ) ;
83+ } else {
84+ assert . deepEqual ( selectResult , binlogRows ) ;
9585 }
96- ) ;
86+
87+ test . end ( ) ;
88+ } ) ;
9789 } ) ;
9890 } ) ;
9991 } ) ;
@@ -258,6 +250,21 @@ defineTypeTest(
258250 ]
259251) ;
260252
253+ defineTypeTest (
254+ 'time_fraction' ,
255+ [ 'TIME(3) NULL' , 'DATETIME(6) NULL' , 'TIMESTAMP(2) NULL' ] ,
256+ [ [ "'17:51:04.777'" , "'2018-09-08 17:51:04.777'" , "'2018-09-08 17:51:04.777'" ] ] ,
257+ function ( _ , event ) {
258+ assert . deepEqual ( event . rows , [
259+ {
260+ col0 : '17:51:04.777' ,
261+ col1 : '2018-09-08 17:51:04.777000' ,
262+ col2 : '2018-09-08 17:51:04.78'
263+ }
264+ ] ) ;
265+ }
266+ ) ;
267+
261268defineTypeTest (
262269 'datetime_no_fraction' ,
263270 [ 'DATETIME NULL' ] ,
0 commit comments