new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
36
tests/init/tuninit1.nim
Normal file
36
tests/init/tuninit1.nim
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
discard """
|
||||
errormsg: "'y' might not have been initialized"
|
||||
line:34
|
||||
"""
|
||||
|
||||
import strutils
|
||||
|
||||
{.warning[Uninit]:on.}
|
||||
|
||||
proc p =
|
||||
var x, y, z: int
|
||||
if stdin.readLine == "true":
|
||||
x = 34
|
||||
|
||||
while false:
|
||||
y = 999
|
||||
break
|
||||
|
||||
while true:
|
||||
if x == 12: break
|
||||
y = 9999
|
||||
|
||||
try:
|
||||
z = parseInt("1233")
|
||||
except E_Base:
|
||||
case x
|
||||
of 34: z = 123
|
||||
of 13: z = 34
|
||||
else: z = 8
|
||||
else:
|
||||
y = 3444
|
||||
x = 3111
|
||||
z = 0
|
||||
echo x, y, z
|
||||
|
||||
p()
|
||||
18
tests/init/tzeroarray.nim
Normal file
18
tests/init/tzeroarray.nim
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
discard """
|
||||
output: done
|
||||
"""
|
||||
|
||||
for i in 0 .. 1:
|
||||
var a: array[0..4, int]
|
||||
if a[0] != 0: quit "bug"
|
||||
a[0] = 6
|
||||
|
||||
proc main =
|
||||
for i in 0 .. 1:
|
||||
var a: array[0..4, int]
|
||||
if a[0] != 0: quit "bug"
|
||||
a[0] = 6
|
||||
|
||||
main()
|
||||
echo "done"
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue