/**
* QUnit v1.5.0 - A JavaScript Unit Testing Framework
*
* http://docs.jquery.com/QUnit
*
* Copyright (c) 2012 John Resig, Jörn Zaefferer
* Dual licensed under the MIT (MIT-LICENSE.txt)
* or GPL (GPL-LICENSE.txt) licenses.
*/
/**
* jsDump Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com |
* http://flesler.blogspot.com Licensed under BSD
* (http://www.opensource.org/licenses/bsd-license.php) Date: 5/15/2008
*
* @projectDescription Advanced and extensible data dumping for Javascript.
* @version 1.0.0
* @author Ariel Flesler
* @link {http://flesler.blogspot.com/2008/05/jsdump-pretty-dump-of-any-javascript.html}
*/
/*
* Javascript Diff Algorithm
* By John Resig (http://ejohn.org/)
* Modified by Chu Alan "sprite"
*
* Released under the MIT license.
*
* More Info:
* http://ejohn.org/projects/javascript-diff-algorithm/
*
* Usage: QUnit.diff(expected, actual)
*
* QUnit.diff("the quick brown fox jumped over", "the quick fox jumps over") == "the quick brown fox jumped jumps over"
*/
!function(e){function t(){x.autorun=!0,x.currentModule&&m("moduleDone",T,{name:x.currentModule,failed:x.moduleStats.bad,passed:x.moduleStats.all-x.moduleStats.bad,total:x.moduleStats.all});var e=f("qunit-banner"),t=f("qunit-tests"),n=+new Date-x.started,r=x.stats.all-x.stats.bad,s=["Tests completed in ",n," milliseconds. ",'',r,' tests of ',x.stats.all,' passed, ',x.stats.bad," failed."].join("");if(e&&(e.className=x.stats.bad?"qunit-fail":"qunit-pass"),t&&(f("qunit-testresult").innerHTML=s),x.altertitle&&"undefined"!=typeof document&&document.title&&(document.title=[x.stats.bad?"✖":"✔",document.title.replace(/^[\u2714\u2716] /i,"")].join(" ")),x.reorder&&b.sessionStorage&&0===x.stats.bad)for(var o,i=0;i]/g,function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";default:return e}})):""}function i(e,t){x.queue.push(e),x.autorun&&!x.blocking&&a(t)}function a(n){function r(){a(n)}var s=(new Date).getTime();for(x.depth=x.depth?x.depth+1:1;x.queue.length&&!x.blocking;){if(!(!b.setTimeout||x.updateRate<=0||(new Date).getTime()-s0&&T.pushFailure("Introduced global variable(s): "+t.join(", "));var n=c(e,x.pollution);n.length>0&&T.pushFailure("Deleted global variable(s): "+n.join(", "))}function c(e,t){for(var n=e.slice(),r=0;rn;n++)if(t[n]===e)return n;return-1}var b={setTimeout:"undefined"!=typeof e.setTimeout,sessionStorage:function(){var e="qunit-test-string";try{return sessionStorage.setItem(e,e),sessionStorage.removeItem(e),!0}catch(t){return!1}}()},y=0,w=Object.prototype.toString,q=Object.prototype.hasOwnProperty,E=function(e,t,n,r,s){this.name=e,this.testName=t,this.expected=n,this.async=r,this.callback=s,this.assertions=[]};E.prototype={init:function(){var e=f("qunit-tests");if(e){var t=document.createElement("strong");t.innerHTML="Running "+this.name;var n=document.createElement("li");n.appendChild(t),n.className="running",n.id=this.id="test-output"+y++,e.appendChild(n)}},setup:function(){if(this.module!=x.previousModule?(x.previousModule&&m("moduleDone",T,{name:x.previousModule,failed:x.moduleStats.bad,passed:x.moduleStats.all-x.moduleStats.bad,total:x.moduleStats.all}),x.previousModule=this.module,x.moduleStats={all:0,bad:0},m("moduleStart",T,{name:this.module})):x.autorun&&m("moduleStart",T,{name:this.module}),x.current=this,this.testEnvironment=d({setup:function(){},teardown:function(){}},this.moduleTestEnvironment),m("testStart",T,{name:this.testName,module:this.module}),T.current_testEnvironment=this.testEnvironment,x.pollution||u(),x.notrycatch)return this.testEnvironment.setup.call(this.testEnvironment),void 0;try{this.testEnvironment.setup.call(this.testEnvironment)}catch(e){T.pushFailure("Setup failed on "+this.testName+": "+e.message,r(e,1))}},run:function(){x.current=this;var e=f("qunit-testresult");if(e&&(e.innerHTML="Running: "+this.name),this.async&&T.stop(),x.notrycatch)return this.callback.call(this.testEnvironment),void 0;try{this.callback.call(this.testEnvironment)}catch(t){T.pushFailure("Died on test #"+(this.assertions.length+1)+": "+t.message,r(t,1)),u(),x.blocking&&T.start()}},teardown:function(){if(x.current=this,x.notrycatch)return this.testEnvironment.teardown.call(this.testEnvironment),void 0;try{this.testEnvironment.teardown.call(this.testEnvironment)}catch(e){T.pushFailure("Teardown failed on "+this.testName+": "+e.message,r(e,1))}l()},finish:function(){x.current=this,null!=this.expected&&this.expected!=this.assertions.length?T.pushFailure("Expected "+this.expected+" assertions, but "+this.assertions.length+" were run"):null!=this.expected||this.assertions.length||T.pushFailure("Expected at least one assertion, but none were run - call expect(0) to accept zero assertions.");var t,n,r=0,s=0,o=f("qunit-tests");if(x.stats.all+=this.assertions.length,x.moduleStats.all+=this.assertions.length,o){var i=document.createElement("ol");for(n=0;n("+s+", "+r+", "+this.assertions.length+")";var l=document.createElement("a");l.innerHTML="Rerun",l.href=T.url({filter:g([u]).replace(/\([^)]+\)$/,"").replace(/(^\s*|\s*$)/g,"")}),p(u,"click",function(){var e=u.nextSibling.nextSibling,t=e.style.display;e.style.display="none"===t?"block":"none"}),p(u,"dblclick",function(t){var n=t&&t.target?t.target:e.event.srcElement;("span"==n.nodeName.toLowerCase()||"b"==n.nodeName.toLowerCase())&&(n=n.parentNode),e.location&&"strong"===n.nodeName.toLowerCase()&&(e.location=T.url({filter:g([n]).replace(/\([^)]+\)$/,"").replace(/(^\s*|\s*$)/g,"")}))}),t=f(this.id),t.className=s?"fail":"pass",t.removeChild(t.firstChild),t.appendChild(u),t.appendChild(l),t.appendChild(i)}else for(n=0;n";if(2===arguments.length&&(r=t,t=null),x.currentModule&&(i=''+x.currentModule+": "+i),n(x.currentModule+": "+e)){var a=new E(i,e,t,s,r);a.module=x.currentModule,a.moduleTestEnvironment=x.currentModuleTestEnviroment,a.queue()}},expect:function(e){x.current.expected=e},ok:function(e,t){if(!x.current)throw new Error("ok() assertion outside test context, was "+s(2));e=!!e;var n={result:e,message:t};if(t=o(t||(e?"okay":"failed")),!e){var r=s(2);r&&(n.source=r,t+='
Source:
'+o(r)+"
")}m("log",T,n),x.current.assertions.push({result:e,message:t})},equal:function(e,t,n){T.push(t==e,e,t,n)},notEqual:function(e,t,n){T.push(t!=e,e,t,n)},deepEqual:function(e,t,n){T.push(T.equiv(e,t),e,t,n)},notDeepEqual:function(e,t,n){T.push(!T.equiv(e,t),e,t,n)},strictEqual:function(e,t,n){T.push(t===e,e,t,n)},notStrictEqual:function(e,t,n){T.push(t!==e,e,t,n)},raises:function(e,t,n){var r,s=!1;"string"==typeof t&&(n=t,t=null);try{e.call(x.current.testEnvironment)}catch(o){r=o}r&&(t?"regexp"===T.objectType(t)?s=t.test(r):r instanceof t?s=!0:t.call({},r)===!0&&(s=!0):s=!0),T.ok(s,n)},start:function(t){x.semaphore-=t||1,x.semaphore>0||(x.semaphore<0&&(x.semaphore=0),b.setTimeout?e.setTimeout(function(){x.semaphore>0||(x.timeout&&clearTimeout(x.timeout),x.blocking=!1,a(!0))},13):(x.blocking=!1,a(!0)))},stop:function(t){x.semaphore+=t||1,x.blocking=!0,x.testTimeout&&b.setTimeout&&(clearTimeout(x.timeout),x.timeout=e.setTimeout(function(){T.ok(!1,"Test timed out"),x.semaphore=1,T.start()},x.testTimeout))}};!function(){function e(){}e.prototype=T,T=new e,T.constructor=e}(),T.equals=function(){T.push(!1,!1,!1,"QUnit.equals has been deprecated since 2009 (e88049a0), use QUnit.equal instead")},T.same=function(){T.push(!1,!1,!1,"QUnit.same has been deprecated since 2009 (e88049a0), use QUnit.deepEqual instead")};var x={queue:[],blocking:!0,hidepassed:!1,reorder:!0,altertitle:!0,urlConfig:["noglobals","notrycatch"],begin:[],done:[],log:[],testStart:[],testDone:[],moduleStart:[],moduleDone:[]};!function(){var t,n=e.location||{search:"",protocol:"file:"},r=n.search.slice(1).split("&"),s=r.length,o={};if(r[0])for(var i=0;s>i;i++)t=r[i].split("="),t[0]=decodeURIComponent(t[0]),t[1]=t[1]?decodeURIComponent(t[1]):!0,o[t[0]]=t[1];T.urlParams=o,x.filter=o.filter,T.isLocal="file:"===n.protocol}(),("undefined"==typeof exports||"undefined"==typeof require)&&(d(e,T),e.QUnit=T),d(T,{config:x,init:function(){d(x,{stats:{all:0,bad:0},moduleStats:{all:0,bad:0},started:+new Date,updateRate:1e3,blocking:!1,autostart:!0,autorun:!1,filter:"",queue:[],semaphore:0});var e=f("qunit");e&&(e.innerHTML='
'+o(document.title)+"
"+''+''+''+'');var t=f("qunit-tests"),n=f("qunit-banner"),r=f("qunit-testresult");t&&(t.innerHTML=""),n&&(n.className=""),r&&r.parentNode.removeChild(r),t&&(r=document.createElement("p"),r.id="qunit-testresult",r.className="result",t.parentNode.insertBefore(r,t),r.innerHTML="Running... ")},reset:function(){if(e.jQuery)jQuery("#qunit-fixture").html(x.fixture);else{var t=f("qunit-fixture");t&&(t.innerHTML=x.fixture)}},triggerEvent:function(e,t,n){document.createEvent?(n=document.createEvent("MouseEvents"),n.initMouseEvent(t,!0,!0,e.ownerDocument.defaultView,0,0,0,0,0,!1,!1,!1,!1,0,null),e.dispatchEvent(n)):e.fireEvent&&e.fireEvent("on"+t)},is:function(e,t){return T.objectType(t)==e},objectType:function(e){if("undefined"==typeof e)return"undefined";if(null===e)return"null";var t=w.call(e).match(/^\[object\s(.*)\]$/)[1]||"";switch(t){case"Number":return isNaN(e)?"nan":"number";case"String":case"Boolean":case"Array":case"Date":case"RegExp":case"Function":return t.toLowerCase()}return"object"==typeof e?"object":void 0},push:function(e,t,n,r){if(!x.current)throw new Error("assertion outside test context, was "+s());var i={result:e,message:r,actual:t,expected:n};r=o(r)||(e?"okay":"failed"),r=''+r+"";var a=r;if(!e){n=o(T.jsDump.parse(n)),t=o(T.jsDump.parse(t)),a+='