new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
26
tests/constr/tconstr2.nim
Normal file
26
tests/constr/tconstr2.nim
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
discard """
|
||||
file: "tconstr2.nim"
|
||||
output: "69"
|
||||
"""
|
||||
# Test array, record constructors
|
||||
|
||||
type
|
||||
TComplexRecord = tuple[
|
||||
s: string,
|
||||
x, y: int,
|
||||
z: float,
|
||||
chars: set[char]]
|
||||
|
||||
const
|
||||
things: array [0..1, TComplexRecord] = [
|
||||
(s: "hi", x: 69, y: 45, z: 0.0, chars: {'a', 'b', 'c'}),
|
||||
(s: "hi", x: 69, y: 45, z: 1.0, chars: {})]
|
||||
otherThings = [ # the same
|
||||
(s: "hi", x: 69, y: 45, z: 0.0, chars: {'a', 'b', 'c'}),
|
||||
(s: "hi", x: 69, y: 45, z: 1.0, chars: {'a'})]
|
||||
|
||||
write(stdout, things[0].x)
|
||||
#OUT 69
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue