forked from libxmljs/libxmljs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomment.ts
More file actions
36 lines (31 loc) · 1.02 KB
/
comment.ts
File metadata and controls
36 lines (31 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import * as libxml from "../index";
module.exports.new = function(assert: any) {
var doc = libxml.Document();
var comm = libxml.Comment(doc, 'comment1');
doc.root(comm);
assert.equal('comment1', comm.text());
assert.done();
};
module.exports.text = function(assert: any) {
var doc = libxml.Document();
var comm = libxml.Comment(doc);
comm.text('comment2');
assert.equal('comment2', comm.text());
assert.done();
};
module.exports.textWithSpecialCharacters = function(assert: any) {
var doc = libxml.Document();
var comm = libxml.Comment(doc);
var theText = 'my comment <has> special ch&r&cters';
comm.text(theText);
assert.equal(theText, comm.text());
assert.done();
};
module.exports.toStringWithSpecialCharacters = function(assert: any) {
var doc = libxml.Document();
var comm = libxml.Comment(doc);
var theText = 'my comment <has> special ch&r&cters';
comm.text(theText);
assert.equal("<!--" + theText + "-->", comm.toString());
assert.done();
};