Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Small check to make sure cdata is added and represented in the string…

… form for GH-124.

Signed-off-by: Nick Campbell <nicholas.j.campbell@gmail.com>
  • Loading branch information...
commit 09d5598c705c952c3c879aa3102a5a47a356c724 1 parent b1a9a9a
Nick Campbell ncb000gt authored
Showing with 19 additions and 0 deletions.
  1. +19 −0 test/document.js
19 test/document.js
View
@@ -107,6 +107,25 @@ module.exports.add_child_nodes = function(assert) {
assert.done();
};
+module.exports.add_cdata_nodes = function(assert) {
+ var gchild = '';
+ var doc1_string = [
+ '<?xml version="1.0" encoding="UTF-8"?>',
+ '<root><child to="wongfoo"/></root>',
+ ].join("\n");
+
+ var expected_string = [
+ '<?xml version="1.0" encoding="UTF-8"?>',
+ '<root><child to="wongfoo"><![CDATA[<p>Bacon</p>]]></child></root>',
+ '' /* Why?!? */
+ ].join("\n");
+
+ var doc1 = libxml.parseXmlString(doc1_string);
+ doc1.child(0).cdata('<p>Bacon</p>');
+ assert.equal(doc1.toString(), expected_string);
+ assert.done();
+};
+
module.exports.cloned_node = function(assert) {
var gchild_string = '<grandchild from="julie numar">with love</grandchild>';
var doc1_string = [
Please sign in to comment.
Something went wrong with that request. Please try again.