diff options
Diffstat (limited to 'tests/accept/compile/tlastmod.nim')
-rw-r--r-- | tests/accept/compile/tlastmod.nim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/accept/compile/tlastmod.nim b/tests/accept/compile/tlastmod.nim new file mode 100644 index 000000000..75b047fc8 --- /dev/null +++ b/tests/accept/compile/tlastmod.nim @@ -0,0 +1,18 @@ +# test the new LastModificationTime() proc + +import + os, times, strutils + +proc main() = + var + a, b: TTime + a = getLastModificationTime(ParamStr(1)) + b = getLastModificationTime(ParamStr(2)) + writeln(stdout, $a) + writeln(stdout, $b) + if a < b: + Write(stdout, "$2 is newer than $1\n" % [ParamStr(1), ParamStr(2)]) + else: + Write(stdout, "$1 is newer than $2\n" % [ParamStr(1), ParamStr(2)]) + +main() |