Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Xts Acts
提交
829498d9
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看板
提交
829498d9
编写于
2月 09, 2022
作者:
S
shikai-123
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Signed-off-by: shikai-123 <lifansheng1@huawei.com>
Modify xts of xml/convertxml
上级
71e34048
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
36 addition
and
36 deletion
+36
-36
compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js
...nvertxml_lib_standard/src/main/js/test/convertxml.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
+35
-35
未找到文件。
compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js
浏览文件 @
829498d9
...
@@ -291,7 +291,7 @@ describe('XmlTest', function () {
...
@@ -291,7 +291,7 @@ describe('XmlTest', function () {
'
<todo>Play</todo>
'
+
'
<todo>Play</todo>
'
+
'
</note>
'
;
'
</note>
'
;
var
convertml
=
new
convertXml
.
ConvertXML
();
var
convertml
=
new
convertXml
.
ConvertXML
();
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreC
data
:
true
})
var
result1
=
convertml
.
convert
(
xml
,
{
compact
:
false
,
ignoreC
DATA
:
true
})
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
var
str1
=
'
{"_declaration":{"_attributes":{"version":"1.0",
'
+
'
"encoding":"utf-8"}},
'
+
'
"encoding":"utf-8"}},
'
+
'
"_elements":[{"_type":"element",
'
+
'
"_elements":[{"_type":"element",
'
+
...
...
compileruntime/xml_lib_standard/src/main/js/test/xml.test.js
浏览文件 @
829498d9
...
@@ -803,17 +803,17 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -803,17 +803,17 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetComm
ne
t001
* @tc.name: testSetComm
en
t001
* @tc.desc: Writes the comm
ne
t.
* @tc.desc: Writes the comm
en
t.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetComm
ne
t001
'
,
0
,
function
()
{
it
(
'
testSetComm
en
t001
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
setComm
ne
t
(
"
Hi!
"
);
thatSer
.
setComm
en
t
(
"
Hi!
"
);
thatSer
.
endElement
();
thatSer
.
endElement
();
var
result
=
'
<note>
\r\n
<!--Hi!-->
\r\n
</note>
'
;
var
result
=
'
<note>
\r\n
<!--Hi!-->
\r\n
</note>
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
...
@@ -825,17 +825,17 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -825,17 +825,17 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetComm
ne
t002
* @tc.name: testSetComm
en
t002
* @tc.desc: Writes the comm
ne
t.
* @tc.desc: Writes the comm
en
t.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetComm
ne
t002
'
,
0
,
function
()
{
it
(
'
testSetComm
en
t002
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
setComm
ne
t
(
"
Hello, World!
"
);
thatSer
.
setComm
en
t
(
"
Hello, World!
"
);
thatSer
.
endElement
();
thatSer
.
endElement
();
var
result
=
'
<note>
\r\n
<!--Hello, World!-->
\r\n
</note>
'
;
var
result
=
'
<note>
\r\n
<!--Hello, World!-->
\r\n
</note>
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
...
@@ -847,16 +847,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -847,16 +847,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetComm
ne
t003
* @tc.name: testSetComm
en
t003
* @tc.desc: Writes the comm
ne
t.
* @tc.desc: Writes the comm
en
t.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetComm
ne
t003
'
,
0
,
function
()
{
it
(
'
testSetComm
en
t003
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
setComm
ne
t
(
"
Hello, World!
"
);
thatSer
.
setComm
en
t
(
"
Hello, World!
"
);
var
result
=
'
<!--Hello, World!-->
'
;
var
result
=
'
<!--Hello, World!-->
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view1
=
""
;
var
view1
=
""
;
...
@@ -867,16 +867,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -867,16 +867,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetComm
ne
t004
* @tc.name: testSetComm
en
t004
* @tc.desc: Writes the comm
ne
t.
* @tc.desc: Writes the comm
en
t.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetComm
ne
t004
'
,
0
,
function
()
{
it
(
'
testSetComm
en
t004
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
setComm
ne
t
(
"
Hello, World!
"
);
thatSer
.
setComm
en
t
(
"
Hello, World!
"
);
var
result
=
'
<!--Hello, World!-->
'
;
var
result
=
'
<!--Hello, World!-->
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view1
=
""
;
var
view1
=
""
;
...
@@ -887,16 +887,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -887,16 +887,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetComm
ne
t005
* @tc.name: testSetComm
en
t005
* @tc.desc: Writes the comm
ne
t.
* @tc.desc: Writes the comm
en
t.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetComm
ne
t005
'
,
0
,
function
()
{
it
(
'
testSetComm
en
t005
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
setComm
ne
t
(
"
Hello, World!
"
);
thatSer
.
setComm
en
t
(
"
Hello, World!
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
endElement
();
thatSer
.
endElement
();
var
result
=
'
<!--Hello, World!-->
\r\n
<note/>
'
;
var
result
=
'
<!--Hello, World!-->
\r\n
<note/>
'
;
...
@@ -1015,16 +1015,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -1015,16 +1015,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetCD
ata
001
* @tc.name: testSetCD
ATA
001
* @tc.desc: Writes the CDATA.
* @tc.desc: Writes the CDATA.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetCD
ata
001
'
,
0
,
function
()
{
it
(
'
testSetCD
ATA
001
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
setCD
ata
(
'
root SYSTEM
'
)
thatSer
.
setCD
ATA
(
'
root SYSTEM
'
)
var
result
=
'
<![CDATA[root SYSTEM]]>
'
;
var
result
=
'
<![CDATA[root SYSTEM]]>
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view1
=
""
;
var
view1
=
""
;
...
@@ -1035,16 +1035,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -1035,16 +1035,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetCD
ata
002
* @tc.name: testSetCD
ATA
002
* @tc.desc: Writes the CDATA.
* @tc.desc: Writes the CDATA.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetCD
ata
002
'
,
0
,
function
()
{
it
(
'
testSetCD
ATA
002
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
setCD
ata
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
thatSer
.
setCD
ATA
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
var
result
=
'
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
'
;
var
result
=
'
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view1
=
""
;
var
view1
=
""
;
...
@@ -1055,18 +1055,18 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -1055,18 +1055,18 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetCD
ata
003
* @tc.name: testSetCD
ATA
003
* @tc.desc: Writes the CDATA.
* @tc.desc: Writes the CDATA.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetCD
ata
003
'
,
0
,
function
()
{
it
(
'
testSetCD
ATA
003
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
endElement
();
thatSer
.
endElement
();
thatSer
.
setCD
ata
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
thatSer
.
setCD
ATA
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
var
result
=
'
<note/>
\r\n
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
'
;
var
result
=
'
<note/>
\r\n
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view1
=
""
;
var
view1
=
""
;
...
@@ -1077,16 +1077,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -1077,16 +1077,16 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetCD
ata
004
* @tc.name: testSetCD
ATA
004
* @tc.desc: Writes the CDATA.
* @tc.desc: Writes the CDATA.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetCD
ata
004
'
,
0
,
function
()
{
it
(
'
testSetCD
ATA
004
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
setCD
ata
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
thatSer
.
setCD
ATA
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
thatSer
.
startElement
(
"
note
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
endElement
();
thatSer
.
endElement
();
var
result
=
'
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
\r\n
<note/>
'
;
var
result
=
'
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
\r\n
<note/>
'
;
...
@@ -1099,17 +1099,17 @@ describe('XmlSerializerXmlPullParserTest', function () {
...
@@ -1099,17 +1099,17 @@ describe('XmlSerializerXmlPullParserTest', function () {
})
})
/**
/**
* @tc.name: testSetCD
ata
005
* @tc.name: testSetCD
ATA
005
* @tc.desc: Writes the CDATA.
* @tc.desc: Writes the CDATA.
* @tc.require: AR000GGRB8
* @tc.require: AR000GGRB8
* @tc.author: lihucheng
* @tc.author: lihucheng
*/
*/
it
(
'
testSetCD
ata
005
'
,
0
,
function
()
{
it
(
'
testSetCD
ATA
005
'
,
0
,
function
()
{
const
myMAX
=
2048
;
const
myMAX
=
2048
;
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
arrayBuffer
=
new
ArrayBuffer
(
myMAX
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
var
thatSer
=
new
xml
.
XmlSerializer
(
arrayBuffer
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
startElement
(
"
note
"
);
thatSer
.
setCD
ata
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
thatSer
.
setCD
ATA
(
'
root SYSTEM "http://www.test.org/test.dtd"
'
)
thatSer
.
endElement
();
thatSer
.
endElement
();
var
result
=
'
<note>
\r\n
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
\r\n
</note>
'
;
var
result
=
'
<note>
\r\n
<![CDATA[root SYSTEM "http://www.test.org/test.dtd"]]>
\r\n
</note>
'
;
var
view
=
new
Uint8Array
(
arrayBuffer
);
var
view
=
new
Uint8Array
(
arrayBuffer
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录