forked from PencilCode/jquery-turtle
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtouches.html
More file actions
31 lines (30 loc) · 724 Bytes
/
touches.html
File metadata and controls
31 lines (30 loc) · 724 Bytes
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
<script src="lib/qunit.js"></script>
<link href="lib/qunit.css" rel="stylesheet">
<script src="lib/jquery.js"></script>
<script src="../jquery-turtle.js"></script>
<body>
<div id="qunit" style="opacity:.3"></div>
<script>
eval($.turtle());
module("Test of touches command.");
asyncTest("Checks touches.", function() {
speed(Infinity);
ok(touches([0, 0]));
ok(touches(pagexy()));
var x = new Turtle(red);
ok(touches(x));
x.fd(100);
ok(!touches(x));
ok(!touches([0, -100]));
ok(!touches({pageX: 0, pageY: 0}));
ok(!touches(null));
ok(!touches(lastmouse));
x.dot(red);
ok(!touches(red));
ok(x.touches(red));
ok(x.touches(transparent));
x.bk(50);
ok(!x.touches(red));
start();
});
</script>