mirror of
https://github.com/servo/servo.git
synced 2025-06-24 17:14:33 +01:00
s/isnot/is_not/ in harness.js
For sake of harness.js interface harmony.
This commit is contained in:
parent
3933d17262
commit
c9716df7ed
10 changed files with 22 additions and 22 deletions
|
@ -21,12 +21,12 @@ function _printer(opstr, op) {
|
|||
}
|
||||
|
||||
var is = _printer("==", function (a,b) { return a == b; });
|
||||
var is_not = _printer("!=", function (a,b) { return a != b; });
|
||||
var is_a = _printer("is a", function (a,b) { return a instanceof b; });
|
||||
var is_not_a = _printer("is not a", function (a,b) { return !(a instanceof b); });
|
||||
var is_in = _printer("is in", function (a,b) { return a in b; });
|
||||
var is_not_in = _printer("is not in", function (a,b) { return !(a in b); });
|
||||
var as_str_is = _printer("as string is", function (a,b) { return String(a) == b; });
|
||||
var isnot = _printer("!=", function (a,b) { return a != b; });
|
||||
var lt = _printer("<", function (a,b) { return a < b; });
|
||||
var gt = _printer(">", function (a,b) { return a > b; });
|
||||
var leq = _printer("<=", function (a,b) { return a <= b; });
|
||||
|
|
|
@ -16,7 +16,7 @@ function check_collection(obj, num, classes, name) {
|
|||
classes = [Element, HTMLElement].concat(classes);
|
||||
|
||||
for (var i=0; i<obj.length; i++) {
|
||||
isnot(obj[i], null);
|
||||
is_not(obj[i], null);
|
||||
is(obj[i].tagName, name);
|
||||
for (var j=0; j<classes.length; j++) {
|
||||
is_a(obj[i], classes[j]);
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<script>
|
||||
// test1: existing document's body
|
||||
{
|
||||
isnot(document.body, null, "test1-0, existing document's body");
|
||||
is_not(document.body, null, "test1-0, existing document's body");
|
||||
is_a(document.body, HTMLBodyElement, "test1-1, exising document's body");
|
||||
is(document.body && document.body.tagName, "BODY", "test1-2, existing document's body");
|
||||
}
|
||||
|
@ -14,7 +14,7 @@
|
|||
// test2: replace document's body with new body
|
||||
{
|
||||
let new_body = document.createElement("body");
|
||||
isnot(new_body, null, "test2-0, replace document's body with new body");
|
||||
is_not(new_body, null, "test2-0, replace document's body with new body");
|
||||
document.body = new_body;
|
||||
is(new_body, document.body, "test2-1, replace document's body with new body");
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
|||
// test3: replace document's body with new frameset
|
||||
{
|
||||
let new_frameset = document.createElement("frameset");
|
||||
isnot(new_frameset, null, "test2-0, replace document's body with new frameset");
|
||||
is_not(new_frameset, null, "test2-0, replace document's body with new frameset");
|
||||
document.body = new_frameset;
|
||||
is(new_frameset, document.body, "test2-1, replace document's body with new frameset");
|
||||
}
|
||||
|
@ -33,7 +33,7 @@
|
|||
new_document.appendChild(new_document.createElement("html"));
|
||||
let new_div = new_document.createElement("div");
|
||||
|
||||
isnot(new_div, null, "test4-0, append an invalid element to a new document");
|
||||
is_not(new_div, null, "test4-0, append an invalid element to a new document");
|
||||
|
||||
new_document.body = new_div;
|
||||
is(new_document.body, null, "test4-1, append an invalid element to a new document");
|
||||
|
@ -45,7 +45,7 @@
|
|||
new_document.appendChild(new_document.createElement("html"));
|
||||
let new_body = new_document.createElement("body");
|
||||
|
||||
isnot(new_body, null, "test5-0, append body to a new document");
|
||||
is_not(new_body, null, "test5-0, append body to a new document");
|
||||
is_a(new_body, HTMLBodyElement, "test5-1, append body to a new document");
|
||||
is(new_body && new_body.tagName, "BODY", "test5-2, append body to a new document");
|
||||
|
||||
|
@ -59,7 +59,7 @@
|
|||
new_document.appendChild(new_document.createElement("html"));
|
||||
let new_frameset = new_document.createElement("frameset");
|
||||
|
||||
isnot(new_frameset, null, "test6-0, append frameset to a new document");
|
||||
is_not(new_frameset, null, "test6-0, append frameset to a new document");
|
||||
is_a(new_frameset, HTMLFrameSetElement, "test6-1, append frameset to a new document");
|
||||
is(new_frameset && new_frameset.tagName, "FRAMESET", "test6-2, append frameset to a new document");
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
// test1: createProcessingInstruction
|
||||
{
|
||||
var pi = document.createProcessingInstruction("xml-stylesheet", "href=\"mycss.css\" type=\"text/css\"");
|
||||
isnot(pi, null, "test1-0: createProcessingInstruction");
|
||||
is_not(pi, null, "test1-0: createProcessingInstruction");
|
||||
is_a(pi, ProcessingInstruction, "test1-1: createProcessingInstruction");
|
||||
is(pi.target, "xml-stylesheet", "test1-2: createProcessingInstruction");
|
||||
is(pi.data, "href=\"mycss.css\" type=\"text/css\"", "test1-3: createProcessingInstruction");
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<script>
|
||||
// test1: document with doctype
|
||||
{
|
||||
isnot(document.doctype, document.firstChild, "test1-0, document with doctype");
|
||||
isnot(document.doctype, null, "test1-1, document with doctype");
|
||||
is_not(document.doctype, document.firstChild, "test1-0, document with doctype");
|
||||
is_not(document.doctype, null, "test1-1, document with doctype");
|
||||
is_a(document.doctype, DocumentType, "test1-2, document with doctype");
|
||||
}
|
||||
|
||||
|
|
|
@ -11,12 +11,12 @@
|
|||
// test1: on static page
|
||||
{
|
||||
let foo = document.getElementById("foo");
|
||||
isnot(foo, null, "test-1-0, on static page");
|
||||
is_not(foo, null, "test-1-0, on static page");
|
||||
is(foo && foo.tagName, "HEAD", "test1-1, on static page");
|
||||
is_a(foo, HTMLHeadElement, "test1-2, on static page");
|
||||
|
||||
let bar = document.getElementById("bar");
|
||||
isnot(bar, null, "test1-3, on static page");
|
||||
is_not(bar, null, "test1-3, on static page");
|
||||
is(bar && bar.tagName, "DIV", "test1-4, on static page");
|
||||
is_a(bar, HTMLDivElement, "test1-5, on static page");
|
||||
}
|
||||
|
@ -30,7 +30,7 @@
|
|||
|
||||
// test: appended element
|
||||
let appended = document.getElementById(TEST_ID);
|
||||
isnot(appended, null, "test2-0, appended element");
|
||||
is_not(appended, null, "test2-0, appended element");
|
||||
is(appended && appended.tagName, "DIV", "test2-1, appended element");
|
||||
is_a(appended, HTMLDivElement, "test2-2, appended element");
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<script>
|
||||
// test1: existing document's head
|
||||
{
|
||||
isnot(document.head, null, "test1-0, existing document's head");
|
||||
is_not(document.head, null, "test1-0, existing document's head");
|
||||
is_a(document.head, HTMLHeadElement, "test1-1, exising document's head");
|
||||
is(document.head && document.head.tagName, "HEAD", "test1-2, existing document's head");
|
||||
}
|
||||
|
@ -17,7 +17,7 @@
|
|||
new_document.appendChild(new_document.createElement("html"));
|
||||
let new_head = new_document.createElement("head");
|
||||
|
||||
isnot(new_head, null, "test2-0, append head to a new document");
|
||||
is_not(new_head, null, "test2-0, append head to a new document");
|
||||
is_a(new_head, HTMLHeadElement, "test2-1, append head to a new document");
|
||||
is(new_head && new_head.tagName, "HEAD", "test2-2, append head to a new document");
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<script>
|
||||
// test1: basic test
|
||||
{
|
||||
isnot(document.implementation, null, "test1-0, basic test");
|
||||
is_not(document.implementation, null, "test1-0, basic test");
|
||||
is_a(document.implementation, DOMImplementation, "test1-1, basic test");
|
||||
|
||||
var implementation = document.implementation;
|
||||
|
@ -25,7 +25,7 @@
|
|||
// test3: createHTMLDocument
|
||||
{
|
||||
var htmldoc = document.implementation.createHTMLDocument("example title");
|
||||
isnot(htmldoc, null, "test3-0, createHTMLDocument");
|
||||
is_not(htmldoc, null, "test3-0, createHTMLDocument");
|
||||
is_a(htmldoc, Document, "test3-1, createHTMLDocument");
|
||||
is(htmldoc.childNodes.length, 2, "test3-3, createHTMLDocument");
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
<script>
|
||||
// test1: URL & documentURI
|
||||
{
|
||||
isnot(document.URL, null, "test1-0, URL & documentURI");
|
||||
isnot(document.documentURI, null, "test1-1, URL & documentURI");
|
||||
is_not(document.URL, null, "test1-0, URL & documentURI");
|
||||
is_not(document.documentURI, null, "test1-1, URL & documentURI");
|
||||
is(document.URL, document.documentURI, "test1-2, URL & documentURI");
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
var doc_doctype = document.doctype;
|
||||
var new_doctype = document.implementation.createDocumentType("html", null, null);
|
||||
|
||||
isnot(doc_doctype, new_doctype, "test2-0, doctype");
|
||||
is_not(doc_doctype, new_doctype, "test2-0, doctype");
|
||||
is(document.replaceChild(new_doctype, doc_doctype), doc_doctype, "test2-1, doctype");
|
||||
is(document.doctype, new_doctype, "test2-2, doctype");
|
||||
}
|
||||
|
@ -41,7 +41,7 @@
|
|||
var doc_elem = document.documentElement;
|
||||
var new_elem = document.createElement("html");
|
||||
|
||||
isnot(doc_elem, new_elem, "test3-0, documentElement");
|
||||
is_not(doc_elem, new_elem, "test3-0, documentElement");
|
||||
is(document.replaceChild(new_elem, doc_elem), doc_elem, "test3-1, documentElement");
|
||||
is(document.documentElement, new_elem, "test3-2, documentElement");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue