File tree 1 file changed +18
-0
lines changed
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) {
48
48
test . end ( ) ;
49
49
} ) ;
50
50
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
+
51
69
test . test ( "should convert" , function ( test ) {
52
70
var buf = protobuf . util . newBuffer ( 3 ) ;
53
71
buf [ 0 ] = buf [ 1 ] = buf [ 2 ] = 49 ; // "111"
You can’t perform that action at this time.
0 commit comments