makes tests green again
This commit is contained in:
parent
0134a51a7c
commit
628ad4b753
1 changed files with 4 additions and 3 deletions
|
|
@ -15,8 +15,9 @@ template toFloatHelper(result: expr; tooSmall, tooLarge: stmt) {.immediate.} =
|
||||||
tooLarge
|
tooLarge
|
||||||
|
|
||||||
proc toFloat*(a: int): float =
|
proc toFloat*(a: int): float =
|
||||||
toFloatHelper(result)
|
toFloatHelper(result) do:
|
||||||
do: raise newException(ValueError, "number too small"):
|
raise newException(ValueError, "number too small")
|
||||||
raise newException(ValueError, "number too large")
|
do:
|
||||||
|
raise newException(ValueError, "number too large")
|
||||||
|
|
||||||
echo toFloat(8)
|
echo toFloat(8)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue