1 // runs a test and writes a log
2 function t(collection, elements) {
4 testRunner.dumpAsText();
7 r = document.getElementById("r"),
9 if(collection.length != elements.length) {
11 log += "Got " + collection.length + " elements, expected " + elements.length + ". "
13 for(var i = 0, max = collection.length > elements.length ? elements.length : collection.length; i < max; i++) {
14 if(collection[i] != elements[i]) {
16 log += "Got element `" + collection[i].tagName + "` (" + collection[i].namespaceURI + ")"
17 log += ", expected element `" + elements[i].tagName + "` (" + elements[i].namespaceURI + "). "
20 r.textContent = pass ? "PASS" : "FAIL (" + log + ")"