1/* 2* Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 3* Licensed under the Apache License, Version 2.0 (the "License"); 4* you may not use this file except in compliance with the License. 5* You may obtain a copy of the License at 6* 7* http://www.apache.org/licenses/LICENSE-2.0 8* 9* Unless required by applicable law or agreed to in writing, software 10* distributed under the License is distributed on an "AS IS" BASIS, 11* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12* See the License for the specific language governing permissions and 13* limitations under the License. 14*/ 15const test = require("./out/build/Release/napitest") 16var assert = require("assert"); 17 18describe('[]', function () { 19 it('test testArray', function () { 20 let ret = test.testArray(['kkk', 'hhh']); 21 assert.deepStrictEqual(ret, []); 22 }); 23 24 it('test testArray1', function () { 25 let ret = test.testArray1([15, 18]); 26 assert.deepStrictEqual(ret, []); 27 }); 28 29 it('test testArray2', function () { 30 let ret = test.testArray2([true, false]); 31 assert.deepStrictEqual(ret, []); 32 }); 33 34 it('test fun4', function () { 35 let ret = test.fun4( 36 ['kkk', 'hhh'], [{ 'name': 'kkk', 'age': 18 }, 37 { 'name': 'kkk', 'age': 18 }]); 38 assert.strictEqual(JSON.stringify(ret), '[]'); 39 }); 40 41 it('test fun5', function () { 42 let ret = test.fun5([12, 18], 43 [{ 'name': 'kkk', 'age': 18 }, { 'name': 'kkk', 'age': 18 }]); 44 assert.strictEqual(JSON.stringify(ret), '[]'); 45 }); 46 47 it('test fun6', function () { 48 let ret = test.fun6([true, false], 49 [{ 'name': 'kkk', 'age': 18 }, { 'name': 'kkk', 'age': 18 }]); 50 assert.strictEqual(JSON.stringify(ret), '[]'); 51 }); 52 53 it('test fun21', function () { 54 let ret = test.fun21('sdfghjk', 55 [{ key: [11,12],value: ['aa','bb'],isExit: [true,true]}, 56 { key: [13,14],value: ['cc','dd'],isExit: [false,false]}]); 57 assert.strictEqual(JSON.stringify(ret),'[]'); 58 }); 59}); 60