Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
9a866e32
X
Xts Acts
项目概览
OpenHarmony
/
Xts Acts
大约 1 年 前同步成功
通知
9
Star
22
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
X
Xts Acts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9a866e32
编写于
2月 12, 2022
作者:
O
openharmony_ci
提交者:
Gitee
2月 12, 2022
浏览文件
操作
浏览文件
下载
差异文件
!1891 Replace lite with index
Merge pull request !1891 from 小马奔腾/master
上级
065e8aab
7046273a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
347 addition
and
71 deletion
+347
-71
compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js
...nvertxml_lib_standard/src/main/js/test/convertxml.test.js
+1
-1
compileruntime/process_lib_standard/src/main/js/test/Process.test.js
...ime/process_lib_standard/src/main/js/test/Process.test.js
+326
-50
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
+12
-12
compileruntime/url_lib_standard/src/main/js/test/url.test.js
compileruntime/url_lib_standard/src/main/js/test/url.test.js
+6
-6
compileruntime/util_lib_standard/src/main/js/test/util.test.js
...leruntime/util_lib_standard/src/main/js/test/util.test.js
+1
-1
compileruntime/xml_lib_standard/src/main/js/test/xml.test.js
compileruntime/xml_lib_standard/src/main/js/test/xml.test.js
+1
-1
未找到文件。
compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js
浏览文件 @
9a866e32
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
lite
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
index
'
import
convertXml
from
'
@ohos.convertxml
'
describe
(
'
XmlTest
'
,
function
()
{
...
...
compileruntime/process_lib_standard/src/main/js/test/Process.test.js
浏览文件 @
9a866e32
...
...
@@ -12,22 +12,298 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
lite
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
index
'
import
process
from
'
@ohos.process
'
describe
(
'
ChildProcessTest
'
,
function
()
{
/**
* @tc.name: testRunCmd001
* @tc.desc: Return a child process object and spawns a new ChildProcess to run the command.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testRunCmd001
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo abc
'
)
child
.
wait
()
var
array
=
new
Uint8Array
([
97
,
98
,
99
,
10
,
0
])
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testRunCmd002
* @tc.desc: Return a child process object and spawns a new ChildProcess to run the command.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testRunCmd002
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo abc;
'
,
{
maxBuffer
:
2
})
child
.
wait
()
var
array
=
new
Uint8Array
([
97
,
98
,
0
])
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testRunCmd003
* @tc.desc: Return a child process object and spawns a new ChildProcess to run the command.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testRunCmd003
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
sleep 5; echo abc;
'
,
{
timeout
:
1
,
killSignal
:
9
})
child
.
wait
()
var
array
=
new
Uint8Array
([
0
])
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
expect
(
child
.
exitCode
).
assertEqual
(
9
)
done
();
})
/**
* @tc.name: testRunCmd004
* @tc.desc: Return a child process object and spawns a new ChildProcess to run the command.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testRunCmd004
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
sleep 2; echo abc;
'
,
{
timeout
:
9000
,
killSignal
:
9
})
child
.
wait
()
var
array
=
new
Uint8Array
([
97
,
98
,
99
,
10
,
0
])
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
expect
(
child
.
exitCode
).
assertEqual
(
0
)
done
();
})
/**
* @tc.name: testRunCmd005
* @tc.desc: Return a child process object and spawns a new ChildProcess to run the command.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testRunCmd005
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo abc
'
,
{
maxBuffer
:
1000
})
child
.
wait
()
var
array
=
new
Uint8Array
([
97
,
98
,
99
,
10
,
0
])
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testGetOutput001
* @tc.desc: return it as 'Uint8Array' of the stdout until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetOutput001
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo bcd;
'
)
var
array
=
new
Uint8Array
([
98
,
99
,
100
,
10
,
0
])
child
.
wait
();
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testGetOutput002
* @tc.desc: return it as 'Uint8Array' of the stdout until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetOutput002
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo 123;
'
);
var
array
=
new
Uint8Array
([
49
,
50
,
51
,
10
,
0
]);
child
.
wait
();
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
]);
}
});
done
();
})
/**
* @tc.name: testGetOutput003
* @tc.desc: return it as 'Uint8Array' of the stdout until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetOutput003
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo helloWorld;
'
);
var
array
=
new
Uint8Array
([
104
,
101
,
108
,
108
,
111
,
87
,
111
,
114
,
108
,
100
,
10
,
0
]);
child
.
wait
();
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
]);
}
});
done
();
})
/**
* @tc.name: testGetOutput004
* @tc.desc: return it as 'Uint8Array' of the stdout until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetOutput004
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo 浣犲�?
'
);
var
array
=
new
Uint8Array
([
230
,
181
,
163
,
231
,
138
,
178
,
239
,
191
,
189
,
63
,
10
,
0
]);
child
.
wait
();
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
]);
}
});
done
();
})
/**
* @tc.name: testGetOutput005
* @tc.desc: return it as 'Uint8Array' of the stdout until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetOutput005
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo ~_~;
'
);
var
array
=
new
Uint8Array
([
126
,
95
,
126
,
10
,
0
]);
child
.
wait
();
await
child
.
getOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
]);
}
});
done
();
})
/**
* @tc.name: testGetErrorOutput001
* @tc.desc: return it as 'Uint8Array of the stderr until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetErrorOutput001
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
makdir 1.txt
'
)
child
.
wait
()
var
array
=
new
Uint8Array
([
115
,
104
,
58
,
32
,
109
,
97
,
107
,
100
,
105
,
114
,
58
,
32
,
105
,
110
,
97
,
99
,
99
,
101
,
115
,
115
,
105
,
98
,
108
,
101
,
32
,
111
,
114
,
32
,
110
,
111
,
116
,
32
,
102
,
111
,
117
,
110
,
100
,
10
,
0
])
await
child
.
getErrorOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testGetErrorOutput002
* @tc.desc: return it as 'Uint8Array of the stderr until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetErrorOutput002
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo "error" 1>&2
'
)
child
.
wait
()
var
array
=
new
Uint8Array
([
101
,
114
,
114
,
111
,
114
,
10
,
0
])
await
child
.
getErrorOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testGetErrorOutput003
* @tc.desc: return it as 'Uint8Array of the stderr until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetErrorOutput003
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
1
'
)
child
.
wait
()
var
array
=
new
Uint8Array
([
115
,
104
,
58
,
32
,
49
,
58
,
32
,
105
,
110
,
97
,
99
,
99
,
101
,
115
,
115
,
105
,
98
,
108
,
101
,
32
,
111
,
114
,
32
,
110
,
111
,
116
,
32
,
102
,
111
,
117
,
110
,
100
,
10
,
0
])
await
child
.
getErrorOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testGetErrorOutput004
* @tc.desc: return it as 'Uint8Array of the stderr until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetErrorOutput004
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
chmod 777 123
'
)
var
array
=
new
Uint8Array
([
99
,
104
,
109
,
111
,
100
,
58
,
32
,
49
,
50
,
51
,
58
,
32
,
78
,
111
,
32
,
115
,
117
,
99
,
104
,
32
,
102
,
105
,
108
,
101
,
32
,
111
,
114
,
32
,
100
,
105
,
114
,
101
,
99
,
116
,
111
,
114
,
121
,
10
,
0
]);
child
.
wait
();
await
child
.
getErrorOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testGetErrorOutput005
* @tc.desc: return it as 'Uint8Array of the stderr until EOF.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testGetErrorOutput005
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
cp ./1 ./2
'
)
var
array
=
new
Uint8Array
([
99
,
112
,
58
,
32
,
98
,
97
,
100
,
32
,
39
,
46
,
47
,
49
,
39
,
58
,
32
,
78
,
111
,
32
,
115
,
117
,
99
,
104
,
32
,
102
,
105
,
108
,
101
,
32
,
111
,
114
,
32
,
100
,
105
,
114
,
101
,
99
,
116
,
111
,
114
,
121
,
10
,
0
])
child
.
wait
();
await
child
.
getErrorOutput
().
then
(
val
=>
{
for
(
var
i
=
0
;
i
<
array
.
length
;
i
++
)
{
expect
(
val
[
i
]).
assertEqual
(
array
[
i
])
}
});
done
();
})
/**
* @tc.name: testWait001
* @tc.desc: return 'number' is the targer process exit code.
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testWait001
'
,
0
,
async
function
()
{
it
(
'
testWait001
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
ls
'
)
var
status
=
child
.
wait
()
status
.
then
(
val
=>
{
await
child
.
wait
().
then
(
val
=>
{
expect
(
val
).
assertEqual
(
0
)
})
});
done
();
})
/**
...
...
@@ -36,13 +312,13 @@ describe('ChildProcessTest', function () {
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testWait002
'
,
0
,
async
function
()
{
it
(
'
testWait002
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
ls; sleep 5;
'
)
child
.
kill
(
9
);
var
status
=
child
.
wait
()
status
.
then
(
val
=>
{
await
child
.
wait
().
then
(
val
=>
{
expect
(
val
).
assertEqual
(
9
)
})
});
done
();
})
/**
...
...
@@ -51,12 +327,12 @@ describe('ChildProcessTest', function () {
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testWait003
'
,
0
,
async
function
()
{
it
(
'
testWait003
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
echo helloWorld
'
);
var
status
=
child
.
wait
();
status
.
then
(
val
=>
{
await
child
.
wait
().
then
(
val
=>
{
expect
(
val
).
assertEqual
(
0
);
})
});
done
();
})
/**
...
...
@@ -65,12 +341,12 @@ describe('ChildProcessTest', function () {
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testWait004
'
,
0
,
async
function
()
{
it
(
'
testWait004
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
mkdir 123
'
);
var
status
=
child
.
wait
();
status
.
then
(
val
=>
{
expect
(
val
).
assertEqual
(
256
);
})
await
child
.
wait
().
then
(
val
=>
{
expect
(
val
).
assertEqual
(
0
);
}
);
done
();
})
/**
...
...
@@ -79,12 +355,12 @@ describe('ChildProcessTest', function () {
* @tc.require: AR000GFB2S
* @tc.author: wangben
*/
it
(
'
testWait005
'
,
0
,
async
function
()
{
it
(
'
testWait005
'
,
0
,
async
function
(
done
)
{
var
child
=
process
.
runCmd
(
'
sleep 5; echo abc;
'
,
{
timeout
:
1
,
killSignal
:
9
});
var
status
=
child
.
wait
();
status
.
then
(
val
=>
{
await
child
.
wait
().
then
(
val
=>
{
expect
(
val
).
assertEqual
(
9
);
})
});
done
();
})
/**
...
...
@@ -1510,7 +1786,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
})
/**
...
...
@@ -1527,7 +1803,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1545,7 +1821,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1696,7 +1972,7 @@ describe('ChildProcessTest', function () {
if
(
pres
!=
-
1
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1741,7 +2017,7 @@ describe('ChildProcessTest', function () {
if
(
pri
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1759,7 +2035,7 @@ describe('ChildProcessTest', function () {
if
(
pri
>
0
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
}
})
...
...
@@ -1778,7 +2054,7 @@ describe('ChildProcessTest', function () {
if
(
pri
>
0
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
}
})
...
...
@@ -1798,7 +2074,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1815,7 +2091,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
})
/**
...
...
@@ -1833,7 +2109,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1852,7 +2128,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1870,7 +2146,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1886,7 +2162,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
})
/**
...
...
@@ -1903,7 +2179,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1921,7 +2197,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1938,7 +2214,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
})
/**
...
...
@@ -1956,7 +2232,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1975,7 +2251,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -1992,7 +2268,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
})
/**
...
...
@@ -2008,7 +2284,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
})
/**
...
...
@@ -2023,7 +2299,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
})
/**
...
...
@@ -2040,7 +2316,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -2058,7 +2334,7 @@ describe('ChildProcessTest', function () {
{
var
flag
=
new
Boolean
(
true
)
}
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -2073,7 +2349,7 @@ describe('ChildProcessTest', function () {
var
pri
=
process
.
getEnvironmentVar
(
"
USER
"
)
if
(
pri
!=
null
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
})
...
...
@@ -2090,7 +2366,7 @@ describe('ChildProcessTest', function () {
if
(
pri
!=
null
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
}
})
...
...
@@ -2108,7 +2384,7 @@ describe('ChildProcessTest', function () {
if
(
pri
!=
null
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
}
})
...
...
@@ -2126,7 +2402,7 @@ describe('ChildProcessTest', function () {
if
(
pri
!=
null
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
}
})
...
...
@@ -2144,7 +2420,7 @@ describe('ChildProcessTest', function () {
if
(
pri
!=
null
)
{
var
flag
=
new
Boolean
(
true
)
expect
(
flag
).
assertEqual
(
true
)
expect
(
Boolean
(
flag
)
).
assertEqual
(
true
)
}
}
})
...
...
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
浏览文件 @
9a866e32
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
lite
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
index
'
import
Uri
from
'
@ohos.uri
'
describe
(
'
UriTest
'
,
function
()
{
...
...
@@ -26,7 +26,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
#http://username:password@host:8080/directory/file?foo=1&bar=2
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: #It can't be the first
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: #It can't be the first
"
);
}
})
...
...
@@ -40,7 +40,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
({
name
:
'
gaogao
'
});
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: input type err
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: input type err
"
);
}
})
...
...
@@ -54,7 +54,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: SpecialPath does not conform to the rule
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: SpecialPath does not conform to the rule
"
);
}
})
...
...
@@ -68,7 +68,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
http://username:password@[::]:8080/directory/file?Query#gaogao faofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: Fragment does not conform to the rule
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: Fragment does not conform to the rule
"
);
}
})
...
...
@@ -82,7 +82,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: Query does not conform to the rule
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: Query does not conform to the rule
"
);
}
})
...
...
@@ -96,7 +96,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: Scheme the first character must be a letter
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: Scheme the first character must be a letter
"
);
}
})
...
...
@@ -110,7 +110,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: scheme does not conform to the rule
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: scheme does not conform to the rule
"
);
}
})
...
...
@@ -124,7 +124,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: Prot does not conform to the rule
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: Prot does not conform to the rule
"
);
}
})
...
...
@@ -138,7 +138,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: IPv6 is missing a closing bracket
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: IPv6 is missing a closing bracket
"
);
}
})
...
...
@@ -152,7 +152,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: userInfo does not conform to the rule
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: userInfo does not conform to the rule
"
);
}
})
...
...
@@ -166,7 +166,7 @@ describe('UriTest', function () {
try
{
let
that
=
new
Uri
.
URI
(
'
http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
).
assertEqual
(
"
Error: ipv6 does not conform to the rule
"
);
expect
(
err
.
toString
()
).
assertEqual
(
"
Error: ipv6 does not conform to the rule
"
);
}
})
...
...
compileruntime/url_lib_standard/src/main/js/test/url.test.js
浏览文件 @
9a866e32
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
lite
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
index
'
import
Url
from
'
@ohos.url
'
describe
(
'
UrlFunTest
'
,
function
()
{
...
...
@@ -423,7 +423,7 @@ describe('UrlFunTest', function () {
let
params
=
new
Url
.
URLSearchParams
(
"
key1=value1&key2=value2
"
)
params
.
append
(
"
key1
"
,
"
AAA
"
)
var
result
=
params
.
getAll
(
"
key1
"
)
expect
(
result
).
assertEqual
(
"
value1,AAA
"
)
expect
(
result
.
toString
()
).
assertEqual
(
"
value1,AAA
"
)
})
/**
...
...
@@ -436,7 +436,7 @@ describe('UrlFunTest', function () {
let
params
=
new
Url
.
URLSearchParams
(
"
key1=value1&8=DEF
"
)
params
.
append
(
"
8
"
,
"
A8A
"
)
var
result
=
params
.
getAll
(
"
8
"
)
expect
(
result
).
assertEqual
(
"
DEF,A8A
"
)
expect
(
result
.
toString
()
).
assertEqual
(
"
DEF,A8A
"
)
})
/**
...
...
@@ -449,7 +449,7 @@ describe('UrlFunTest', function () {
let
params
=
new
Url
.
URLSearchParams
(
"
key1=value1&key2=value2&key3=da
"
)
params
.
append
(
"
key3
"
,
"
A3A
"
)
var
result
=
params
.
getAll
(
"
key3
"
)
expect
(
result
).
assertEqual
(
"
da,A3A
"
)
expect
(
result
.
toString
()
).
assertEqual
(
"
da,A3A
"
)
})
/**
...
...
@@ -462,7 +462,7 @@ describe('UrlFunTest', function () {
let
params
=
new
Url
.
URLSearchParams
(
"
key1=value1&key2=value2&key3=大
"
)
params
.
append
(
"
key3
"
,
"
A3A
"
)
var
result
=
params
.
getAll
(
"
key4
"
)
expect
(
result
).
assertEqual
(
''
)
expect
(
result
.
toString
()
).
assertEqual
(
''
)
})
/**
...
...
@@ -475,7 +475,7 @@ describe('UrlFunTest', function () {
let
params
=
new
Url
.
URLSearchParams
(
"
key1=value1&key2=value2&key3=大
"
)
params
.
append
(
"
key3
"
,
"
A3A
"
)
var
result
=
params
.
getAll
(
"
key2
"
)
expect
(
result
).
assertEqual
(
"
value2
"
)
expect
(
result
.
toString
()
).
assertEqual
(
"
value2
"
)
})
/**
...
...
compileruntime/util_lib_standard/src/main/js/test/util.test.js
浏览文件 @
9a866e32
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
lite
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
index
'
import
util
from
'
@ohos.util
'
import
url
from
'
@ohos.url
'
import
app
from
'
@system.app
'
...
...
compileruntime/xml_lib_standard/src/main/js/test/xml.test.js
浏览文件 @
9a866e32
...
...
@@ -12,7 +12,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
lite
'
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/
index
'
import
xml
from
'
@ohos.xml
'
describe
(
'
XmlSerializerXmlPullParserTest
'
,
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录