105 lines
2.3 KiB
HTML
Executable File
105 lines
2.3 KiB
HTML
Executable File
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
|
<link rel="stylesheet" href="qunit/qunit.css" type="text/css" />
|
|
<title>Kis-js test app</title>
|
|
<!--[if IE 8]>
|
|
<script type="text/javascript">
|
|
var HTML5 = "article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(",");
|
|
for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName);
|
|
|
|
</script>
|
|
<![endif]-->
|
|
</head>
|
|
<body>
|
|
<h1 id="qunit-header">Kis-js Test Suite</h1>
|
|
<h2 id="qunit-banner"></h2>
|
|
<div id="qunit-testrunner-toolbar"></div>
|
|
<h2 id="qunit-userAgent"></h2>
|
|
<ol id="qunit-tests"></ol>
|
|
<div id="qunit-fixture">
|
|
test markup, will be hidden
|
|
<span id="testSpan"></span>
|
|
</div>
|
|
<section hidden="hidden">
|
|
<article id="r14">
|
|
This is important text!
|
|
</article>
|
|
<aside id="classChild">
|
|
<p class="child"></p>
|
|
<span class="child"></span>
|
|
<div class="nephew"></div>
|
|
</aside>
|
|
</section>
|
|
<script src="../kis-all.js"></script>
|
|
<script src="qunit/qunit.js"></script>
|
|
<script type="text/javascript">
|
|
//Selector test function
|
|
function $(a)
|
|
{
|
|
var x = document.querySelectorAll(a);
|
|
|
|
//Return the single object if applicable
|
|
return (x.length === 1) ? x[0] : x;
|
|
}
|
|
|
|
//Object equivalence function
|
|
function is_clone(o1, o2)
|
|
{
|
|
var n,
|
|
flag=true;
|
|
|
|
for(n in o1)
|
|
{
|
|
//Do a shallow compare -- first level only
|
|
if($_.type(o1[n]) === "object")
|
|
{
|
|
if($_.type(o2[n]) !== "object")
|
|
{
|
|
flag = false;
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(o1[n] !== o2[n])
|
|
{
|
|
flag = false;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
for(n in o2)
|
|
{
|
|
//Do a shallow compare -- first level only
|
|
if($_.type(o1[n]) === "object")
|
|
{
|
|
if($_.type(o2[n]) !== "object")
|
|
{
|
|
flag = false;
|
|
break;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if(o2[n] !== o1[n])
|
|
{
|
|
flag = false;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
|
|
return flag;
|
|
}
|
|
</script>
|
|
<script src="tests/core.js"></script>
|
|
<script src="tests/ajax.js"></script>
|
|
<script src="tests/event.js"></script>
|
|
<script src="tests/dom.js"></script>
|
|
<script src="tests/store.js"></script>
|
|
<script src="tests/util.js"></script>
|
|
</body>
|
|
</html> |