forked from livecode/livecode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExecBeep.test
More file actions
31 lines (23 loc) · 693 Bytes
/
ExecBeep.test
File metadata and controls
31 lines (23 loc) · 693 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
setup
-- 'beep' should produce 1 beep and take a certain amout of time
local tBeepTime
put the millisecs into tBeepTime
beep
put the millisecs - tBeepTime into tBeepTime
-- 'beep 0' should take less than beep
local tTime
put the millisecs into tTime
beep 0
put the millisecs - tTime into tTime
test tTime <= tBeepTime / 2.0
-- 'beep 1' should take about the same time as beep
put the millisecs into tTime
beep 1
put the millisecs - tTime into tTime
test abs(tTime - tBeepTime) < 0.1
-- 'beep 2' should take about twice the time of beep + 0.5
put the millisecs into tTime
beep 2
put the millisecs - tTime into tTime
test abs((tTime - tBeepTime) - (2 * tBeepTime + 0.5)) < 0.1
teardown