-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.html
49 lines (42 loc) · 1.36 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
<!DOCTYPE html>
<meta charset="utf-8">
<title>Instapoppin' Unit Tests</title>
<link rel="stylesheet" href="qunit.css">
<script src="qunit.js"></script>
<script src="../instapoppin.js"></script>
<script>
module("Instapoppin.parseDurations()");
test("errors thrown when input can't be parsed", function() {
function ensureFails(str) {
raises(function() {
Instapoppin.parseDurations(str);
}, Instapoppin.ParseError, "'" + str + "' fails");
}
ensureFails("blah");
ensureFails();
ensureFails('');
ensureFails("1");
ensureFails("1-2-3");
ensureFails("1,2-3");
ensureFails("1:05");
ensureFails("1:05:24:23-");
ensureFails("1:05-1:fooble");
});
test("durations provided when input can be parsed", function() {
function ensureWorks(str, expected) {
deepEqual(Instapoppin.parseDurations(str), expected,
"Instapoppin.parseDurations('" + str + "') works");
}
ensureWorks("1-5", [{start: 1, end: 5}]);
ensureWorks("1:05-1:20", [{start: 65, end: 80}]);
ensureWorks("-1:00:20", [{start: 0, end: 3620}]);
ensureWorks("20-", [{start: 20, end: Infinity}]);
ensureWorks("1:05-1:20", [{start: 65, end: 80}]);
});
</script>
<h1 id="qunit-header">Instapoppin' Unit Tests</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>