This repository has been archived by the owner on May 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 863
/
index.html
109 lines (102 loc) · 3.77 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!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>