blob: bcbd11fd3895c657ac7ce98544029c139c333171 (
plain)
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
|
function test_isinf(t)
t:will_raise(function() math.isinf(nil) end)
t:will_raise(function() math.isinf(true) end)
t:require_not(math.isinf(0))
t:require_not(math.isinf(math.nan))
t:are_same(math.isinf(math.inf), 1)
t:are_same(math.isinf(-math.inf), -1)
end
function test_isnan(t)
t:will_raise(function() math.isinf(nil) end)
t:will_raise(function() math.isinf(true) end)
t:require_not(math.isnan(0))
t:require(math.isnan(math.nan))
t:require_not(math.isnan(math.huge))
t:require_not(math.isnan(-math.huge))
end
function test_isint(t)
t:will_raise(function() math.isint(nil) end)
t:will_raise(function() math.isint(true) end)
t:require(math.isint(0))
t:require(math.isint(-10))
t:require(math.isint(123456))
t:require_not(math.isint(123456.1))
t:require_not(math.isint(-9.99))
t:require_not(math.isint(math.nan))
t:require_not(math.isint(math.huge))
t:require_not(math.isint(-math.huge))
end
|