From ac7285fd11e5d70e6c12bebbf9b7512b5d3f404c Mon Sep 17 00:00:00 2001 From: Ricky Reusser Date: Wed, 9 Nov 2016 11:27:27 -0500 Subject: [PATCH] Add failling tests for coerce --- test/jasmine/tests/lib_test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/jasmine/tests/lib_test.js b/test/jasmine/tests/lib_test.js index f57d5c2fc17..63164a77f2f 100644 --- a/test/jasmine/tests/lib_test.js +++ b/test/jasmine/tests/lib_test.js @@ -649,6 +649,24 @@ describe('Test lib.js:', function() { expect(cOut).toBe(outObj.b.c); }); + describe('info_arrays', function () { + it('does not filter empty arrays with freeLength: true', function() { + var attrs = { + x: { + valType: 'info_array', + freeLength: true, + items: [ + { valType: 'any' }, + { valType: 'any' }, + { valType: 'any' } + ] + } + }; + out = coerce({x: [[], 10]}, {}, attrs, 'x'); + expect(out).toEqual([[], 10]); + }); + }); + describe('string valType', function() { var dflt = 'Jabberwock', stringAttrs = {