start of tests refactoring; sqlite3 new wrapper fixes
This commit is contained in:
parent
6bc16904ed
commit
d913fdb280
173 changed files with 206 additions and 238 deletions
27
tests/accept/run/tarray.nim
Normal file
27
tests/accept/run/tarray.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
# simple check for one dimensional arrays
|
||||
|
||||
type
|
||||
TMyArray = array[0..2, int]
|
||||
TMyRecord = tuple[x, y: int]
|
||||
|
||||
proc sum(a: TMyarray): int =
|
||||
result = 0
|
||||
var i = 0
|
||||
while i < len(a):
|
||||
inc(result, a[i])
|
||||
inc(i)
|
||||
|
||||
proc sum(a: openarray[int]): int =
|
||||
result = 0
|
||||
var i = 0
|
||||
while i < len(a):
|
||||
inc(result, a[i])
|
||||
inc(i)
|
||||
|
||||
proc getPos(r: TMyRecord): int =
|
||||
result = r.x + r.y
|
||||
|
||||
write(stdout, sum([1, 2, 3, 4]))
|
||||
write(stdout, sum([]))
|
||||
write(stdout, getPos( (x: 5, y: 7) ))
|
||||
#OUT 10012
|
||||
Loading…
Add table
Add a link
Reference in a new issue