!295 modify codecheck

Merge pull request !295 from zhaojunxia/master
This commit is contained in:
openharmony_ci 2023-09-13 09:24:31 +00:00 committed by Gitee
commit bf471c967e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 10 additions and 11 deletions

View File

@ -62,6 +62,10 @@ describe('Any fun1', function () {
let ret = test.fun1('guding', 'aaa');
assert.strictEqual(ret, 0);
});
});
describe('Any fun1 array map part', function () {
it('test fun1 Array<map<string>>', function () {
let ret = test.fun1([{ "test": "okay", "test1": "res" }, { "test2": "okay2", "test3": "res3" }], 'aaa');
assert.strictEqual(ret, 0);

View File

@ -50,66 +50,61 @@ describe('string case', function () {
assert.strictEqual(err.code, 0)
assert.deepStrictEqual(ret, '')
}
function def1(ret) {
assert.deepStrictEqual(ret, '');
}
// function fun6(v1: string, callback: AsyncCallback<string>): void;
it('test fun6_callback', function () {
test.fun6('15', asynFun1);
test.fun6('15').then(def1);
});
// function fun6(v1: string): Promise<string>;
it('test fun6_promise', function () {
let promiseObj = test.fun6('15');
promiseObj.then(ret => { def1(ret) });
});
});
describe('string case part2', function () {
function asynFun2(err, ret) {
assert.deepStrictEqual(err.code, 0)
assert.deepStrictEqual(ret, [])
}
function def2(ret) {
assert.deepStrictEqual(ret, []);
}
// function fun7(v: string, v1: AsyncCallback<Array<string>>): void;
it('test fun7_callback', function () {
test.fun7('15', asynFun2);
test.fun7('15').then(def2);
});
// function fun7(v: string): Promise<Array<string>>;
it('test fun7_promise', function () {
let promiseObj = test.fun7('15');
promiseObj.then(ret => { def2(ret) });
});
// define callback for fun8
function asynFun8(err, ret) {
assert.deepStrictEqual(err.code, 0)
assert.deepStrictEqual(ret, [])
}
function def8(ret) {
assert.deepStrictEqual(ret, []);
}
// function fun8(v1: string, callback: AsyncCallback<string[]>): void;
it('test fun8_AsyncCallback', function () {
test.fun8('funTest', asynFun8);
test.fun8('funTest').then(def8);
});
// function fun8(v1: string): Promise<string[]>;
it('test fun8_promise', function () {
let promiseObj = test.fun8('funTest');
promiseObj.then(ret => { def8(ret) });
});
});
describe('string case part3', function () {
function cb1(ret) {
assert.deepStrictEqual(ret, '')
}