diff --git a/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js b/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js index 7930f5b80dd046898654e9dd6a1e1d4a2f817ce9..b2afb2b1c8e3a3dfd7832df9d714de6dd6cde760 100644 --- a/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js +++ b/compileruntime/convertxml_lib_standard/src/main/js/test/convertxml.test.js @@ -1130,9 +1130,43 @@ describe('XmlTest', function () { '"_name":"c"}]}]}]}' expect(result1).assertEqual(str1); }) -}) - - - - + /** + * @tc.name: testConvert040 + * @tc.desc: To convert XML text to JavaScript object. + * @tc.require: AR000GFB5B + * @tc.author: lihucheng + */ + it('testConvert040', 0, function () { + var xml = + '' + + ''+ + '' + + ' Happy' + + ' Work' + + ' Play' + + ''; + var convertml = new ConvertXML(); + var result1 = convertml.convert(xml, {compact: false, doctypeKey: 'doctype'}) + var str1 = '{"_declaration":{"_attributes":{"version":"1.0",'+ + '"encoding":"utf-8"}},'+ + '"_elements":[{"_type":"doctype","doctype":"foo"},'+ + '{"_type":"element",'+ + '"_name":"note",'+ + '"_attributes":{"importance":"high",'+ + '"logged":"true"},'+ + '"_elements":[{"_type":"element",'+ + '"_name":"title",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Happy"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Work"}]},'+ + '{"_type":"element",'+ + '"_name":"todo",'+ + '"_elements":[{"_type":"text",'+ + '"_text":"Play"}]}]}]}' + expect(result1).assertEqual(str1); + }) +}) \ No newline at end of file