PageRenderTime 18ms CodeModel.GetById 11ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 1ms

/tests/test-documentfragment.vala

http://libgdom3.googlecode.com/
Vala | 27 lines | 25 code | 2 blank | 0 comment | 4 complexity | 7a79bf52afcb5663d5216840bf2cc90d MD5 | raw file
 1using DOM;
 2class DocumentFragmentTest : TestMan{
 3	DocumentFragmentTest () {
 4		base("/DOM/DocumentFragment");
 5		add("BeInsertedBefore", () => {
 6			Document doc = new Document("root");
 7			DocumentFragment f = doc.createDocumentFragment();
 8			Element e1 = doc.createElement("e1");
 9			Element e2 = doc.createElement("e2");
10			f.appendChild(e1);
11			f.appendChild(e2);
12			doc.documentElement.appendChild(f);
13			assert(e1.parentNode == doc.documentElement);
14			assert(e2.parentNode == doc.documentElement);
15			assert(e1.nextSibling == e2);
16			assert(e2.previousSibling == e1);
17				
18		});
19	}
20	public static int main(string[] args) {
21		Test.init(ref args);
22		DocumentFragmentTest t = new DocumentFragmentTest();
23
24		t.run();
25		return 0;
26	}
27}