提交 37c09f9a 编写于 作者: X xdmal

Signed-off-by: xdmal <1114560882@qq.com>

 On branch master
 Your branch is up to date with 'origin/master'.
上级 f60531f3
......@@ -172,7 +172,7 @@ describe('UrlFunTest', function () {
i++;
arr[i]=pair[1];
i++;
};
}
expect(arr[1]).assertEqual("value1");
})
......@@ -268,7 +268,7 @@ describe('UrlFunTest', function () {
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
};
}
params.forEach(func);
expect(arr[0]).assertEqual("value1 key1 true");
})
......@@ -287,7 +287,7 @@ describe('UrlFunTest', function () {
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
};
}
params.forEach(func);
expect(arr[1]).assertEqual("value2 key2 true");
})
......@@ -307,7 +307,7 @@ describe('UrlFunTest', function () {
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
};
}
params.forEach(func);
expect(arr[2]).assertEqual("jk foo true");
})
......@@ -326,7 +326,7 @@ describe('UrlFunTest', function () {
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
};
}
params.forEach(func);
expect(arr[1]).assertEqual("txt jss true");
})
......@@ -346,7 +346,7 @@ describe('UrlFunTest', function () {
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
};
}
params.forEach(func);
expect(arr[0]).assertEqual("bar foo true");
})
......@@ -553,7 +553,7 @@ describe('UrlFunTest', function () {
for(var key of params.keys()) {
arr[i] = key
i++
};
}
expect(arr[0]).assertEqual("");
})
......@@ -570,7 +570,7 @@ describe('UrlFunTest', function () {
for(var key of params.keys()) {
arr[i] = key
i++
};
}
expect(arr[1]).assertEqual("");
})
......@@ -587,7 +587,7 @@ describe('UrlFunTest', function () {
for(var key of params.keys()) {
arr[i] = key
i++
};
}
expect(arr[2]).assertEqual("key3");
})
......@@ -604,7 +604,7 @@ describe('UrlFunTest', function () {
for(var key of params.keys()) {
arr[i] = key
i++
};
}
expect(arr[3]).assertEqual("key4");
})
......@@ -621,7 +621,7 @@ describe('UrlFunTest', function () {
for(var key of params.keys()) {
arr[i] = key
i++
};
}
expect(arr[4]).assertEqual("key5");
})
......
......@@ -15,6 +15,7 @@
import {describe, beforeAll, beforeEach, afterEach, afterAll, it, expect} from 'deccjsunit/lite'
import Url from '@ohos.url'
describe('UrlFunTest', function () {
/**
* @tc.name: testUrlAppend001
* @tc.desc: Appends a specified key/value pair as a new search parameter.
......@@ -267,7 +268,7 @@ describe('UrlFunTest', function () {
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
};
}
params.forEach(func);
expect(arr[0]).assertEqual("value1 key1 true");
})
......@@ -325,7 +326,7 @@ describe('UrlFunTest', function () {
{
arr[i] = value + " " + key + " " + (params === SearchParams)
i++
};
}
params.forEach(func);
expect(arr[1]).assertEqual("txt jss true");
})
......
......@@ -336,7 +336,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper002', 0, async function () {
async function promiseFn() {
return Promise.resolve('value');
};
}
var cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
expect(err).strictEqual(null);
......@@ -354,7 +354,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper003', 0, async function () {
async function promiseFn() {
return 42;
};
}
var cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
expect(err).strictEqual(null);
......@@ -371,11 +371,13 @@ describe('TextEncoderTest', function () {
*/
it('testUtilCallbackWrapper004', 0, async function () {
async function promiseFn() {
return Promise.reject('value');
};
var err = Error('value');
return Promise.reject(err);
}
var cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
expect(err).strictEqual('value');
expect(err.message).strictEqual('value');
expect(ret).strictEqual(undefined);
})
})
......@@ -390,7 +392,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper005', 0, async function () {
async function promiseFn(a, b) {
return a + b;
};
}
var cb = util.callbackWrapper(promiseFn);
cb(1, 2, (err, ret) => {
expect(err).strictEqual(null);
......@@ -408,7 +410,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper006', 0, async function () {
async function promiseFn(){
return null;
};
}
var cb = util.callbackWrapper(promiseFn);
try {
cb([1, 2])
......@@ -4446,7 +4448,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual('abc');
})
......@@ -4469,7 +4471,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(2);
})
......@@ -4493,7 +4495,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[0]).assertEqual(1);
})
......@@ -4518,7 +4520,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(15)
expect(arr[3]).assertEqual(20)
})
......@@ -4547,7 +4549,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(10)
expect(arr[3]).assertEqual(2)
expect(arr[5]).assertEqual(20)
......@@ -4570,7 +4572,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual('abc');
})
......@@ -4593,7 +4595,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(2);
})
......@@ -4617,7 +4619,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[0]).assertEqual(1);
})
......@@ -4642,7 +4644,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(15)
expect(arr[3]).assertEqual(20)
})
......@@ -4671,7 +4673,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(10)
expect(arr[3]).assertEqual(2)
expect(arr[5]).assertEqual(20)
......@@ -6261,7 +6263,8 @@ describe('TypesTest', function() {
*/
it('testIsPromise004', 0, function() {
var proc = new util.Types();
var result = proc.isPromise(Promise.reject(33));
var err = Error(33);
var result = proc.isPromise(Promise.reject(err ));
expect(result).assertEqual(true);
})
......
......@@ -336,7 +336,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper002', 0, async function () {
async function promiseFn() {
return Promise.resolve('value');
};
}
var cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
expect(err).strictEqual(null);
......@@ -354,7 +354,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper003', 0, async function () {
async function promiseFn() {
return 42;
};
}
var cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
expect(err).strictEqual(null);
......@@ -371,8 +371,10 @@ describe('TextEncoderTest', function () {
*/
it('testUtilCallbackWrapper004', 0, async function () {
async function promiseFn() {
return Promise.reject('value');
};
var err = Error('value');
return Promise.reject(err);
expect(err.message).strictEqual('value');
}
var cb = util.callbackWrapper(promiseFn);
cb((err, ret) => {
expect(err).strictEqual('value');
......@@ -390,7 +392,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper005', 0, async function () {
async function promiseFn(a, b) {
return a + b;
};
}
var cb = util.callbackWrapper(promiseFn);
cb(1, 2, (err, ret) => {
expect(err).strictEqual(null);
......@@ -408,7 +410,7 @@ describe('TextEncoderTest', function () {
it('testUtilCallbackWrapper006', 0, async function () {
async function promiseFn(){
return null;
};
}
var cb = util.callbackWrapper(promiseFn);
try {
cb([1, 2])
......@@ -4446,7 +4448,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual('abc');
})
......@@ -4469,7 +4471,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(2);
})
......@@ -4493,7 +4495,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[0]).assertEqual(1);
})
......@@ -4518,7 +4520,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(15)
expect(arr[3]).assertEqual(20)
})
......@@ -4547,7 +4549,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(10)
expect(arr[3]).assertEqual(2)
expect(arr[5]).assertEqual(20)
......@@ -4570,7 +4572,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual('abc');
})
......@@ -4593,7 +4595,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(2);
})
......@@ -4617,7 +4619,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[0]).assertEqual(1);
})
......@@ -4642,7 +4644,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(15)
expect(arr[3]).assertEqual(20)
})
......@@ -4671,7 +4673,7 @@ describe('LruBufferFunTest', function () {
i++;
arr[i]=entry[1];
i++;
};
}
expect(arr[1]).assertEqual(10)
expect(arr[3]).assertEqual(2)
expect(arr[5]).assertEqual(20)
......@@ -4913,7 +4915,9 @@ describe('TypesTest', function() {
/**
* @tc.name: testIsArrayBufferView001
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_ uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array
or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_
uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.require: AR000GFB59
* @tc.author: wangjingwu
*/
......@@ -4925,7 +4929,9 @@ describe('TypesTest', function() {
/**
* @tc.name: testIsArrayBufferView002
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_ uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array
or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_
int32_ array or napi_ uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.require: AR000GFB59
* @tc.author: wangjingwu
*/
......@@ -4937,7 +4943,9 @@ describe('TypesTest', function() {
/**
* @tc.name: testIsArrayBufferView003
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_ uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_
array or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or
napi_ uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.require: AR000GFB59
* @tc.author: wangjingwu
*/
......@@ -4949,7 +4957,9 @@ describe('TypesTest', function() {
/**
* @tc.name: testIsArrayBufferView004
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_ uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array or naPi_ uint8_
clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_ uint32_ array or
napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.require: AR000GFB59
* @tc.author: wangjingwu
*/
......@@ -4961,7 +4971,9 @@ describe('TypesTest', function() {
/**
* @tc.name: testIsArrayBufferView005
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array or naPi_ uint8_ clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_ uint32_ array or napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.desc: Check whether the entered value is napi_ int8_ array or napi_ uint8_ array or naPi_ uint8_
clamped_ array or naPi_ int16_ array or naPi_ uint16_ array or napi_ int32_ array or napi_ uint32_ array or
napi_ float32_ array or napi_ float64_ array array or DataView type.
* @tc.require: AR000GFB59
* @tc.author: wangjingwu
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册