Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 4e67f5e

Browse files
committed
com.livecode.math: Test for errors with min([]) and max([])
1 parent 04d9c23 commit 4e67f5e

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

tests/lcb/stdlib/math.lcb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,19 +184,27 @@ public handler TestMinBinary()
184184
test "min (function)" when min(4, 5) is 4
185185
end handler
186186

187+
handler TestMinList_Empty()
188+
return the minimum value of []
189+
end handler
187190
public handler TestMinList()
188191
test "min (list)" when the minimum value of [2, 1, 3] is 1
189-
skip test "min (empty list)" because "Can't test for errors"
192+
193+
MCUnitTestHandlerThrows(TestMinList_Empty, "min (empty list)")
190194
end handler
191195

192196
public handler TestMaxBinary()
193197
test "max (syntax)" when the maximum of 3 and 5 is 5
194198
test "max (function)" when max(4, 5) is 5
195199
end handler
196200

201+
handler TestMaxList_Empty()
202+
return the maximum value of []
203+
end handler
197204
public handler TestMaxList()
198205
test "max (list)" when the maximum value of [2, 1, 3] is 3
199-
skip test "max (empty list)" because "Can't test for errors"
206+
207+
MCUnitTestHandlerThrows(TestMaxList_Empty, "max (empty list)")
200208
end handler
201209

202210
public handler TestBaseConvertFrom()

0 commit comments

Comments
 (0)