diff options
author | Andreas Rumpf <andreas@andreas-laptop> | 2010-05-28 23:33:29 +0200 |
---|---|---|
committer | Andreas Rumpf <andreas@andreas-laptop> | 2010-05-28 23:33:29 +0200 |
commit | b34b1dbc6c7290a893149aa9f5ea5d54a37c8522 (patch) | |
tree | d61f14d6f56eab37178242b61c83fdbbd87db30d /tests/accept/compile | |
parent | 6c2050912166a4960b40c3825afb1a31cfdde0eb (diff) | |
download | Nim-b34b1dbc6c7290a893149aa9f5ea5d54a37c8522.tar.gz |
added tests
Diffstat (limited to 'tests/accept/compile')
-rw-r--r-- | tests/accept/compile/tdictdestruct.nim | 16 | ||||
-rw-r--r-- | tests/accept/compile/tgetstartmilsecs.nim | 7 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/accept/compile/tdictdestruct.nim b/tests/accept/compile/tdictdestruct.nim new file mode 100644 index 000000000..20ca4ba94 --- /dev/null +++ b/tests/accept/compile/tdictdestruct.nim @@ -0,0 +1,16 @@ + +type + TDict[TK, TV] = object + k: TK + v: TV + PDict[TK, TV] = ref TDict[TK, TV] + +proc destroyDict[TK, TV](a : PDict[TK, TV]) = + return +proc newDict[TK, TV](a: TK, b: TV): PDict[TK, TV] = + new(result, destroyDict) + + +discard newDict("a", "b") + + diff --git a/tests/accept/compile/tgetstartmilsecs.nim b/tests/accept/compile/tgetstartmilsecs.nim new file mode 100644 index 000000000..340c78af1 --- /dev/null +++ b/tests/accept/compile/tgetstartmilsecs.nim @@ -0,0 +1,7 @@ +# +import times, os + +var start = getStartMilsecs() +os.sleep(1000) + +echo getStartMilsecs() - start #OUT 1000 |