-
Notifications
You must be signed in to change notification settings - Fork 2
/
tests.html
60 lines (55 loc) · 1.24 KB
/
tests.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
<!doctype html>
<html>
<head>
<meta charset=utf-8>
<title>wob.js test suite</title>
<link rel=stylesheet href=qunit/qunit.css>
<script src=qunit/jquery.js></script>
<script src=qunit/qunit.js></script>
<script>
wobtest = true;
</script>
<script src=wob.js></script>
<script>
test('format', function () {
equal(format('foo%sbar', 123), 'foo123bar');
});
asyncTest('urlref', 2, function () {
var ref = urlref.assign('foo');
ok(ref.indexOf('blob:') !== -1);
$.get(ref, function (data) {
start();
equal(data, 'foo');
urlref.revoke(ref);
});
});
asyncTest('wob', function () {
var sum = wob(function (a, b) {
return a + b;
});
sum(3, 4, function(val) {
start();
equal(val, 7);
});
});
asyncTest('queueing', 100, function () {
var f = wob(function (a) {
return a;
});
for (var i = 0; i < 100; i++) {
(function () {
var expected = i;
f(expected, function(val) {
start();
equal(val, expected);
});
}());
}
});
</script>
</head>
<body>
<div id=qunit></div>
<div id=qunit-fixture>test markup</div>
</body>
</html>