diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2021-05-04 23:41:53 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-05 08:41:53 +0200 |
commit | 00bb3c779e88d621c2b655aa5e1079bb0fc80a16 (patch) | |
tree | 04ee47eb2f5dda7d720eb5acf2c13c505f7fa88e | |
parent | 5762b1d75c55900268e1abd0e83aaaa9fd43e9fe (diff) | |
download | Nim-00bb3c779e88d621c2b655aa5e1079bb0fc80a16.tar.gz |
fix https://github.com/timotheecour/Nim/issues/718: CompileTime is not cached apparently (#17940)
-rw-r--r-- | tests/vm/tconst.nim | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/vm/tconst.nim b/tests/vm/tconst.nim index 553f0c136..bb9ad2117 100644 --- a/tests/vm/tconst.nim +++ b/tests/vm/tconst.nim @@ -21,14 +21,17 @@ block: template main() = # xxx merge more const related tests here + const ct = CompileTime + # refs https://github.com/timotheecour/Nim/issues/718, apparently `CompileTime` + # isn't cached, which seems surprising. block: const a = """ Version $1| Compiled at: $2, $3 - """ % [NimVersion & spaces(44-len(NimVersion)), CompileDate, CompileTime] + """ % [NimVersion & spaces(44-len(NimVersion)), CompileDate, ct] let b = $a - doAssert CompileTime in b, $(b, CompileTime) + doAssert ct in b, $(b, ct) doAssert NimVersion in b static: main() |