mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 22:35:24 +00:00
* enable checks for sum, prod, cumsummed and cumsum * fixes #21792 * add test cases
This commit is contained in:
@@ -439,6 +439,20 @@ template main() =
|
||||
doAssert lgamma(-0.0) == Inf
|
||||
doAssert lgamma(-1.0) == Inf
|
||||
|
||||
|
||||
static: main()
|
||||
main()
|
||||
|
||||
when not defined(js) and not defined(danger):
|
||||
block: # bug #21792
|
||||
block:
|
||||
type Digit = 0..9
|
||||
var x = [Digit 4, 7]
|
||||
|
||||
doAssertRaises(RangeDefect):
|
||||
discard sum(x)
|
||||
|
||||
block:
|
||||
var x = [int8 124, 127]
|
||||
|
||||
doAssertRaises(OverflowDefect):
|
||||
discard sum(x)
|
||||
|
||||
Reference in New Issue
Block a user