11/**!
2- * hessian.js - test/array.test.js
3- *
4- * Copyright(c) 2014-2015
2+ * Copyright(c) node-modules and other contributors.
53 * MIT Licensed
64 *
75 * Authors:
@@ -33,6 +31,21 @@ describe('array.test.js', function () {
3331 a . should . eql ( [ null , [ 1 ] ] ) ;
3432 } ) ;
3533
34+ it ( 'should write undefined v1' , function ( ) {
35+ var b = hessian . encode ( [
36+ {
37+ $class : '[java.lang.Integer' ,
38+ $ : undefined
39+ } ,
40+ {
41+ $class : '[java.lang.Integer' ,
42+ $ : [ 1 ]
43+ }
44+ ] ) ;
45+ var a = hessian . decode ( b ) ;
46+ a . should . eql ( [ null , [ 1 ] ] ) ;
47+ } ) ;
48+
3649 it ( 'should write null v2' , function ( ) {
3750 var b = hessian . encode ( [
3851 {
@@ -47,4 +60,19 @@ describe('array.test.js', function () {
4760 var a = hessian . decode ( b , '2.0' ) ;
4861 a . should . eql ( [ null , [ 1 ] ] ) ;
4962 } ) ;
63+
64+ it ( 'should write undefined v2' , function ( ) {
65+ var b = hessian . encode ( [
66+ {
67+ $class : '[java.lang.Integer' ,
68+ $ : undefined
69+ } ,
70+ {
71+ $class : '[java.lang.Integer' ,
72+ $ : [ 1 ]
73+ }
74+ ] , '2.0' ) ;
75+ var a = hessian . decode ( b , '2.0' ) ;
76+ a . should . eql ( [ null , [ 1 ] ] ) ;
77+ } ) ;
5078} ) ;
0 commit comments