File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,24 @@ tape.test("convert", function(test) {
4848 test . end ( ) ;
4949 } ) ;
5050
51+ test . test ( "called with arrays = true" , function ( test ) {
52+ var obj = Message . create ( ) . asJSON ( { arrays : true } ) ;
53+
54+ test . equal ( obj . stringVal , undefined , "should not set stringVal" ) ;
55+ test . same ( obj . stringRepeated , [ ] , "should set stringRepeated" ) ;
56+
57+ test . equal ( obj . uint64Val , undefined , "should not set uint64Val" ) ;
58+ test . same ( obj . uint64Repeated , [ ] , "should set uint64Repeated" ) ;
59+
60+ test . equal ( obj . bytesVal , undefined , "should not set bytesVal" ) ;
61+ test . same ( obj . bytesRepeated , [ ] , "should set bytesRepeated" ) ;
62+
63+ test . equal ( obj . enumVal , undefined , "should not set enumVal" ) ;
64+ test . same ( obj . enumRepeated , [ ] , "should set enumRepeated" ) ;
65+
66+ test . end ( ) ;
67+ } ) ;
68+
5169 test . test ( "should convert" , function ( test ) {
5270 var buf = protobuf . util . newBuffer ( 3 ) ;
5371 buf [ 0 ] = buf [ 1 ] = buf [ 2 ] = 49 ; // "111"
You can’t perform that action at this time.
0 commit comments