Permalink
Fetching contributors…
Cannot retrieve contributors at this time
110 lines (102 sloc) 3.77 KB
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Utility Test Suite</title>
<!-- Include dependencies -->
<script src="../local-only/jquery.js"></script>
<script src="../local-only/jquery.qtip.js"></script>
<script src="../local-only/jed.js"></script>
<script src="../local-only/i18n.js"></script>
<script src="../local-only/localeplanet/icu.en-US.js"></script>
<script>
// TODO(alpert): Ugh, should probably load khan-exercise.js for real...
var Khan = {
query: {},
scriptWait: $.noop,
// This is a random number pulled out of my 32-bit
// pseudo-random hat so that tests are always the same
randomSeed: 0x4e27b400
};
var KhanUtil = Khan.Util = {
debugLog: $.noop,
random: function() {
// Robert Jenkins' 32 bit integer hash function.
var seed = Khan.randomSeed;
seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff;
seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff;
seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff;
seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;
seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff;
seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff;
return (Khan.randomSeed = (seed & 0xfffffff)) / 0x10000000;
},
localeToFixed: function(num, places) {
var decimal = icu.getDecimalFormatSymbols().decimal_separator;
return num.toFixed(places).replace(".", decimal);
}
};
$.fn.runModules = function() {
$.fn.tmpl.apply(this, arguments);
$.fn.tex.apply(this, arguments);
return this;
};
// Since we have some code that calls qtip executed by tests :(
$.fn.qtip = function() { return "fake qtip"; };
</script>
<script src="../local-only/underscore.js"></script>
<script src="../local-only/kas.js"></script>
<script src="../local-only/katex/katex.js"></script>
<!-- Include QUnit -->
<link rel="stylesheet" href="qunit/qunit/qunit.css" type="text/css" media="screen">
<script src="qunit/qunit/qunit.js"></script>
<!-- Include utility files and tests. -->
<script src="../exercises-stub.js"></script>
<script src="../local-only/require.js"></script>
<script>
require([
"../utils/answer-types.js",
"../genfiles/calculator.js",
"../utils/expressions.js",
"../utils/kline.js",
"../utils/kmatrix.js",
"../utils/knumber.js",
"../utils/kpoint.js",
"../utils/kray.js",
"../utils/kvector.js",
"../utils/math.js",
"../utils/polynomials.js",
"../utils/rational-expressions.js",
"../utils/tex.js",
"../utils/tmpl.js",
], function() {
// Now that we've loaded the deps, load the tests
// TODO(alpert): Have these tests use require() reasonably
require([
"answer-types.js",
"calculator.js",
"expressions.js",
"kline.js",
"kmatrix.js",
"knumber.js",
"kpoint.js",
"kray.js",
"kvector.js",
"math.js",
"polynomials.js",
"rational-expressions.js",
"tmpl.js",
], function() {
});
});
</script>
</head>
<body>
<h1 id="qunit-header">Utility 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"></div>
</body>
</html>