new tester; all tests categorized

This commit is contained in:
Araq 2014-01-13 02:10:03 +01:00
commit 20b5f31c03
481 changed files with 794 additions and 2506 deletions

25
tests/enum/tenumhole.nim Normal file
View file

@ -0,0 +1,25 @@
discard """
file: "tenumhole.nim"
output: "my value A1my value Bconc2valueCabc4abc"
"""
const
strValB = "my value B"
type
TMyEnum = enum
valueA = (1, "my value A"),
valueB = strValB & "conc",
valueC,
valueD = (4, "abc")
# test the new "proc body can be an expr" feature:
proc getValue: TMyEnum = valueD
# trick the optimizer with a variable:
var x = getValue()
echo valueA, ord(valueA), valueB, ord(valueB), valueC, valueD, ord(valueD), x