diff options
author | cooldome <ariabushenko@bk.ru> | 2018-04-29 23:26:21 +0100 |
---|---|---|
committer | cooldome <ariabushenko@bk.ru> | 2018-04-29 23:26:21 +0100 |
commit | 0ef93bdea4dba268e7e30e31aab7922ee55168f7 (patch) | |
tree | 8dd1ebd24910501b7cb37f2b08bd5250495a37f4 | |
parent | b3a80dd2eb775367b52c1aed3f130cbdd51d36aa (diff) | |
download | Nim-0ef93bdea4dba268e7e30e31aab7922ee55168f7.tar.gz |
update test
-rw-r--r-- | tests/float/tfloatrange.nim | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/float/tfloatrange.nim b/tests/float/tfloatrange.nim index 56aaf7450..e8ea1912e 100644 --- a/tests/float/tfloatrange.nim +++ b/tests/float/tfloatrange.nim @@ -3,6 +3,7 @@ discard """ output: '''StrictPositiveRange float range fail expected +range fail expected ''' """ import math, fenv @@ -21,7 +22,6 @@ proc myoverload(x: Positive) = proc myoverload(x: StrictPositive) = echo "StrictPositiveRange" - let x = 9.0.StrictPositive myoverload(x) myoverload(9.0) @@ -35,3 +35,15 @@ except: echo "range fail expected" +proc strictOnlyProc(x: StrictPositive): bool = + if x > 1.0: true else: false + +let x2 = 5.0.Positive +doAssert(strictOnlyProc(x2)) + +try: + let x4 = 0.0.Positive + discard strictOnlyProc(x4) +except: + echo "range fail expected" + \ No newline at end of file |