Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
16a6ae5b
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,发现更多精彩内容 >>
提交
16a6ae5b
编写于
2月 15, 2022
作者:
X
xdmal
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Signed-off-by: xdmal <maxiaodong16@huawei.com>
On branch master Your branch is up to date with 'origin/master'.
上级
8874f261
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
96 addition
and
96 deletion
+96
-96
compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js
...nvertxml_lib_standard/src/main/js/test/convertxml.test.js
+40
-40
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
+56
-56
未找到文件。
compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js
浏览文件 @
16a6ae5b
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
convertXml
from
'
@ohos.convertxml
'
import
ConvertXML
from
'
@ohos.convertxml
'
describe
(
'
XmlTest
'
,
function
()
{
/**
...
...
@@ -30,7 +30,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
spaces
:
0
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -67,7 +67,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
trim
:
true
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -104,7 +104,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreDeclaration
:
true
});
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"note",
'
+
...
...
@@ -140,7 +140,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreInstruction
:
true
});
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -178,7 +178,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreAttributes
:
true
});
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -214,7 +214,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreComment
:
true
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -252,7 +252,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreComment
:
true
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -290,7 +290,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreCDATA
:
true
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -325,7 +325,7 @@ describe('XmlTest', function () {
'
<note importance="high" logged="true">
'
+
'
<title>Happy</title>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
spaces
:
4
})
var
str
=
'
{
\n
'
+
'
"_declaration": {
\n
'
+
...
...
@@ -375,7 +375,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreDoctype
:
true
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -412,7 +412,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreText
:
true
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -443,7 +443,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
declarationKey
:
"
123
"
})
var
str1
=
'
{"123":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -481,7 +481,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
instructionKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -522,7 +522,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
attributesKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"123":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -562,7 +562,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
textKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -600,7 +600,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
cdataKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -640,7 +640,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
commentKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -680,7 +680,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
parentKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -721,7 +721,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
typeKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -758,7 +758,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
nameKey
:
"
123
"
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
...
...
@@ -795,7 +795,7 @@ describe('XmlTest', function () {
'
<todo>Work</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
elementsKey
:
"
123
"
})
var
str1
=
'
{"123":[{"123":[{"123":[{"_type":"text",
'
+
'
"_text":"Happy"}],
'
+
...
...
@@ -826,7 +826,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert022
'
,
0
,
function
()
{
var
xml
=
'
<?xml?>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_declaration":{}}
'
expect
(
result1
).
assertEqual
(
str1
);
...
...
@@ -840,7 +840,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert023
'
,
0
,
function
()
{
var
xml
=
'
<?xml version="1.0" encoding="utf-8"?>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}}}
'
...
...
@@ -855,7 +855,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert024
'
,
0
,
function
()
{
var
xml
=
'
<?xml?>
\n
<a/>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_declaration":{},"_elements":[{"_type":"element","_name":"a"}]}
'
expect
(
result1
).
assertEqual
(
str1
);
...
...
@@ -869,7 +869,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert025
'
,
0
,
function
()
{
var
xml
=
'
<?go there?>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"instruction",
'
+
'
"_name":"go",
'
+
...
...
@@ -885,7 +885,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert026
'
,
0
,
function
()
{
var
xml
=
'
<?go there?><?come here?>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"instruction",
'
+
'
"_name":"go",
'
+
...
...
@@ -904,7 +904,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert027
'
,
0
,
function
()
{
var
xml
=
'
<!--
\t
Hello World!
\t
-->
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"comment","_comment":"
'
+
'
\t
'
+
...
...
@@ -923,7 +923,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert028
'
,
0
,
function
()
{
var
xml
=
'
<!--
\t
Hello
\t
-->
\n
<!--
\t
World
\t
-->
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"comment","_comment":"
'
+
'
\t
'
+
...
...
@@ -945,7 +945,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert029
'
,
0
,
function
()
{
var
xml
=
'
<![CDATA[
\t
<foo></bar>
\t
]]>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"cdata","_cdata":"
'
+
'
\t
'
+
...
...
@@ -963,7 +963,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert030
'
,
0
,
function
()
{
var
xml
=
'
<![CDATA[
\t
data]]><![CDATA[< > " and &
\t
]]>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"cdata","_cdata":"
'
+
'
\t
'
+
...
...
@@ -985,7 +985,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert031
'
,
0
,
function
()
{
var
xml
=
'
<a/>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"a"}]}
'
...
...
@@ -1000,7 +1000,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert032
'
,
0
,
function
()
{
var
xml
=
'
<a/>
\n
<a/>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"a"},
'
+
...
...
@@ -1017,7 +1017,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert033
'
,
0
,
function
()
{
var
xml
=
'
<a/>
\n
<b/>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"a"},
'
+
...
...
@@ -1034,7 +1034,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert034
'
,
0
,
function
()
{
var
xml
=
'
<a x="hello"/>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"a",
'
+
...
...
@@ -1050,7 +1050,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert035
'
,
0
,
function
()
{
var
xml
=
'
<a x="1.234" y="It
\'
s"/>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"a",
'
+
...
...
@@ -1067,7 +1067,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert036
'
,
0
,
function
()
{
var
xml
=
'
<a>
\t
Hi
\t
</a>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element","_name":"a","_elements":[{"_type":"text","_text":"
'
+
'
\t
'
+
...
...
@@ -1085,7 +1085,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert037
'
,
0
,
function
()
{
var
xml
=
'
<a> Hi There
\t
</a>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element","_name":"a","_elements":[{"_type":"text","_text":"
'
+
'
Hi
'
+
...
...
@@ -1103,7 +1103,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert038
'
,
0
,
function
()
{
var
xml
=
'
<a>
\n\
v<b/>
\n
</a>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"a",
'
+
...
...
@@ -1120,7 +1120,7 @@ describe('XmlTest', function () {
*/
it
(
'
testConvert039
'
,
0
,
function
()
{
var
xml
=
'
<a>
\n\
v<b>
\n\
v
\
v<c/>
\n\
v</b>
\n
</a>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
})
var
str1
=
'
{"_elements":[{"_type":"element",
'
+
'
"_name":"a",
'
+
...
...
compileruntime/uri_lib_standard/src/main/js/test/uri.test.js
浏览文件 @
16a6ae5b
...
...
@@ -13,7 +13,7 @@
* limitations under the License.
*/
import
{
describe
,
beforeAll
,
beforeEach
,
afterEach
,
afterAll
,
it
,
expect
}
from
'
deccjsunit/index
'
import
U
ri
from
'
@ohos.uri
'
import
U
RI
from
'
@ohos.uri
'
describe
(
'
UriTest
'
,
function
()
{
/**
...
...
@@ -24,7 +24,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor001
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
#http://username:password@host:8080/directory/file?foo=1&bar=2
'
);
let
that
=
new
URI
(
'
#http://username:password@host:8080/directory/file?foo=1&bar=2
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: #It can't be the first
"
);
}
...
...
@@ -38,7 +38,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor002
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
({
name
:
'
gaogao
'
});
let
that
=
new
URI
({
name
:
'
gaogao
'
});
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: input type err
"
);
}
...
...
@@ -52,7 +52,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor003
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2
'
);
let
that
=
new
URI
(
'
ht/tp://username:pas sword@host:8080/directory/file?foo=1&bar=2
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: SpecialPath does not conform to the rule
"
);
}
...
...
@@ -66,7 +66,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor004
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
http://username:password@[::]:8080/directory/file?Query#gaogao faofao
'
);
let
that
=
new
URI
(
'
http://username:password@[::]:8080/directory/file?Query#gaogao faofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: Fragment does not conform to the rule
"
);
}
...
...
@@ -80,7 +80,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor005
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao
'
);
let
that
=
new
URI
(
'
http://username:password@host:8080/directory/file?foo^=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: Query does not conform to the rule
"
);
}
...
...
@@ -94,7 +94,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor006
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
let
that
=
new
URI
(
'
1http://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: Scheme the first character must be a letter
"
);
}
...
...
@@ -108,7 +108,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor007
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
let
that
=
new
URI
(
'
ht@tp://username:password@host:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: scheme does not conform to the rule
"
);
}
...
...
@@ -122,7 +122,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor008
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao
'
);
let
that
=
new
URI
(
'
http://username:password@[::]:80r80/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: Prot does not conform to the rule
"
);
}
...
...
@@ -136,7 +136,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor009
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
let
that
=
new
URI
(
'
http://username:password@[::12:55:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: IPv6 is missing a closing bracket
"
);
}
...
...
@@ -150,7 +150,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor010
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
let
that
=
new
URI
(
'
http://username:pa^ssword@[::12:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: userInfo does not conform to the rule
"
);
}
...
...
@@ -164,7 +164,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor011
'
,
0
,
function
()
{
try
{
let
that
=
new
U
ri
.
U
RI
(
'
http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
let
that
=
new
URI
(
'
http://username:password@[::1你2:55]:8080/directory/file?foo=1&bar=2#gaogaofaofao
'
);
}
catch
(
err
)
{
expect
(
err
.
toString
()).
assertEqual
(
"
Error: ipv6 does not conform to the rule
"
);
}
...
...
@@ -177,7 +177,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor012
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@www.baidu.com:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@www.baidu.com:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@www.baidu.com:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@www.baidu.com:99/path/path?query
"
);
...
...
@@ -196,7 +196,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor013
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[1080::8:800:200C:417A]:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[1080::8:800:200C:417A]:99/path/66path1?query
"
);
...
...
@@ -215,7 +215,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor014
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[::]:88/path/path66?foooo#gaogao
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[::]:88/path/path66?foooo#gaogao
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[::]:88
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[::]:88/path/path66?foooo
"
);
...
...
@@ -234,7 +234,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor015
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[1:0:0:1:2:1:2:1]:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66path1?query
"
);
...
...
@@ -253,7 +253,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor016
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[::FFFF:129.144.52.38]:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[::FFFF:129.144.52.38]:99/path/path?query
"
);
...
...
@@ -272,7 +272,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor017
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[::192.9.5.5]:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[::192.9.5.5]:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[::192.9.5.5]:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[::192.9.5.5]:99/path/path?query
"
);
...
...
@@ -291,7 +291,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor018
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[22::22:2:2%ss]:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[22::22:2:2%ss]:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[22::22:2:2%ss]:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[22::22:2:2%ss]:99/path/path?query
"
);
...
...
@@ -311,7 +311,7 @@ describe('UriTest', function () {
*/
it
(
'
testConstructor019
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99/path/path?query#fagment
'
);
new
URI
(
'
http://gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[fe80:0000:0001:0000:0440:44ff:1233:5678]:99/path/path?query
"
);
...
...
@@ -330,7 +330,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor020
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[fe80::0001:0000]:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[fe80::0001:0000]:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@[fe80::0001:0000]:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@[fe80::0001:0000]:99/path/path?query
"
);
...
...
@@ -349,7 +349,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor021
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@199.98.55.44:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@199.98.55.44:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
gg:gaogao@199.98.55.44:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//gg:gaogao@199.98.55.44:99/path/path?query
"
);
...
...
@@ -368,7 +368,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor022
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://16.9.5.4:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://16.9.5.4:99/path/path?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
16.9.5.4:99
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//16.9.5.4:99/path/path?query
"
);
...
...
@@ -387,7 +387,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor023
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://49.99.54.12:50/path/path23?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://49.99.54.12:50/path/path23?query#fagment
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
49.99.54.12:50
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//49.99.54.12:50/path/path23?query
"
);
...
...
@@ -406,7 +406,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor024
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://user@49.10pe8.54.12:80/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
http://user@49.10pe8.54.12:80/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@49.10pe8.54.12:80
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//user@49.10pe8.54.12:80/path/path23?query
"
);
...
...
@@ -425,7 +425,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor025
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://user@www.baidu.com/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
http://user@www.baidu.com/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@www.baidu.com
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//user@www.baidu.com/path/path23?query
"
);
...
...
@@ -444,7 +444,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor026
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://user@www.hw.com:77/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
http://user@www.hw.com:77/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@www.hw.com:77
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//user@www.hw.com:77/path/path23?query
"
);
...
...
@@ -463,7 +463,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor027
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
ht2tp://user@www.h12343w.com:77/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
ht2tp://user@www.h12343w.com:77/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
ht2tp
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@www.h12343w.com:77
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//user@www.h12343w.com:77/path/path23?query
"
);
...
...
@@ -482,7 +482,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor028
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
ht2tp://user@www.1hw.1com:77/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
ht2tp://user@www.1hw.1com:77/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
ht2tp
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@www.1hw.1com:77
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//user@www.1hw.1com:77/path/path23?query
"
);
...
...
@@ -501,7 +501,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor029
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://user@hosthost/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
http://user@hosthost/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@hosthost
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//user@hosthost/path/path23?query
"
);
...
...
@@ -520,7 +520,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor030
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://user@[::]/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
http://user@[::]/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
user@[::]
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//user@[::]/path/path23?query
"
);
...
...
@@ -539,7 +539,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testConstructor031
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://[::192:0:5]/path/path23?query#qwer
'
);
let
gaogao
=
new
URI
(
'
http://[::192:0:5]/path/path23?query#qwer
'
);
expect
(
gaogao
.
scheme
).
assertEqual
(
"
http
"
);
expect
(
gaogao
.
authority
).
assertEqual
(
"
[::192:0:5]
"
);
expect
(
gaogao
.
ssp
).
assertEqual
(
"
//[::192:0:5]/path/path23?query
"
);
...
...
@@ -558,7 +558,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testEquals001
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
gaogao
;
let
res
=
gaogao
.
equals
(
gaogao1
);
expect
(
res
).
assertEqual
(
true
);
...
...
@@ -571,8 +571,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testEquals002
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
res
=
gaogao
.
equals
(
gaogao1
);
expect
(
res
).
assertEqual
(
true
);
})
...
...
@@ -584,8 +584,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testEquals003
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123
'
);
let
res
=
gaogao
.
equals
(
gaogao1
);
expect
(
res
).
assertEqual
(
false
);
})
...
...
@@ -597,8 +597,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testEquals004
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@wwwaaa:99/path1?query#fagment
'
);
let
gaogao1
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@wwwaaa:99/path1?query#fagment
'
);
let
gaogao1
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment123
'
);
let
res
=
gaogao
.
equals
(
gaogao1
);
expect
(
res
).
assertEqual
(
false
);
})
...
...
@@ -610,8 +610,8 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testEquals005
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
U
ri
.
U
RI
(
'
http://[1:0:0:1:2:1:2:1]/path1?query#fagment123
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path1?query#fagment
'
);
let
gaogao1
=
new
URI
(
'
http://[1:0:0:1:2:1:2:1]/path1?query#fagment123
'
);
let
res
=
gaogao
.
equals
(
gaogao1
);
expect
(
res
).
assertEqual
(
false
);
})
...
...
@@ -623,7 +623,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize001
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/66./../././mm/.././path1?query#fagment
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/path/path1
"
);
expect
(
res
.
toString
()).
assertEqual
(
"
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/path1?query#fagment
"
);
...
...
@@ -636,7 +636,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize002
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/../../path
"
);
expect
(
res
.
toString
()).
assertEqual
(
"
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path?query#fagment
"
);
...
...
@@ -649,7 +649,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize003
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/../../../aa/bb/cc
"
);
expect
(
res
.
toString
()).
assertEqual
(
"
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../../aa/bb/cc?query#fagment
"
);
...
...
@@ -662,7 +662,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize004
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../path/.././../aa/bb/cc?query
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/../../aa/bb/cc
"
);
expect
(
res
.
toString
()).
assertEqual
(
"
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../aa/bb/cc?query
"
);
...
...
@@ -675,7 +675,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testNormalize005
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/./path/./aa/bb/cc?query#fagment
'
);
let
res
=
gaogao
.
normalize
();
expect
(
res
.
path
).
assertEqual
(
"
/path/aa/bb/cc
"
);
expect
(
res
.
toString
()).
assertEqual
(
"
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/path/aa/bb/cc?query#fagment
"
);
...
...
@@ -688,7 +688,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testToString001
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment
'
);
let
res
=
gaogao
.
toString
();
expect
(
res
).
assertEqual
(
'
http://gg:gaogao@[1:0:0:1:2:1:2:1]:99/../../path/.././../aa/bb/cc?query#fagment
'
);
})
...
...
@@ -700,7 +700,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testToString002
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment
'
);
let
gaogao
=
new
URI
(
'
htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment
'
);
let
res
=
gaogao
.
toString
();
expect
(
res
).
assertEqual
(
'
htt1p://gg:gaogao@[::192.9.5.5]:99/path/66path1?query#fagment
'
);
})
...
...
@@ -712,7 +712,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testToString003
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
ftp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
ftp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
toString
();
expect
(
res
).
assertEqual
(
'
ftp://username:password@www.baidu.com:88/path?query#fagment
'
);
})
...
...
@@ -724,7 +724,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testToString004
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gao你好gao@199.98.55.44:99/path/p你好ath?qu你好ery#fag你好ment
'
);
let
res
=
gaogao
.
toString
();
expect
(
res
).
assertEqual
(
'
http://gg:gao%E4%BD%A0%E5%A5%BDgao@199.98.55.44:99/path/
'
+
'
p%E4%BD%A0%E5%A5%BDath?qu%E4%BD%A0%E5%A5%BDery#fag%E4%BD%A0%E5%A5%BDment
'
);
...
...
@@ -737,7 +737,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testToString005
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http://gg:gaogao@199.98.55.44:99/path/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http://gg:gaogao@199.98.55.44:99/path/path?query#fagment
'
);
let
res
=
gaogao
.
toString
();
expect
(
res
).
assertEqual
(
'
http://gg:gaogao@199.98.55.44:99/path/path?query#fagment
'
);
})
...
...
@@ -749,7 +749,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testCheckIsAbsolute001
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
f/tp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
f/tp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
checkIsAbsolute
();
expect
(
res
).
assertEqual
(
false
);
})
...
...
@@ -761,7 +761,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testCheckIsAbsolute002
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
ftp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
ftp://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
checkIsAbsolute
();
expect
(
res
).
assertEqual
(
true
);
})
...
...
@@ -773,7 +773,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testCheckIsAbsolute003
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
htt/p://username:password@www.baidu.com:88/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
htt/p://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
checkIsAbsolute
();
expect
(
res
).
assertEqual
(
false
);
})
...
...
@@ -785,7 +785,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testCheckIsAbsolute004
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
https://username:password@www.baidu.com:88/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
https://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
checkIsAbsolute
();
expect
(
res
).
assertEqual
(
true
);
})
...
...
@@ -797,7 +797,7 @@ describe('UriTest', function () {
* @tc.author: zhaoduwei
*/
it
(
'
testCheckIsAbsolute005
'
,
0
,
function
()
{
let
gaogao
=
new
U
ri
.
U
RI
(
'
http1://username:password@www.baidu.com:88/path?query#fagment
'
);
let
gaogao
=
new
URI
(
'
http1://username:password@www.baidu.com:88/path?query#fagment
'
);
let
res
=
gaogao
.
checkIsAbsolute
();
expect
(
res
).
assertEqual
(
true
);
})
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录