summary refs log tree commit diff stats
path: root/tests/stdlib
diff options
context:
space:
mode:
authorringabout <43030857+ringabout@users.noreply.github.com>2023-01-27 06:03:59 +0800
committerGitHub <noreply@github.com>2023-01-26 23:03:59 +0100
commitfc068ee06d058b35d2d5890cf1fa3c356e549d1f (patch)
tree89dd50f106db8f5165b305af6fcf3cafef5efa06 /tests/stdlib
parent23bd812b0c531dbb6a9854a81030468bbae29cd8 (diff)
downloadNim-fc068ee06d058b35d2d5890cf1fa3c356e549d1f.tar.gz
fixes #18134; registers `formatBiggestFloat` in VM (#21299)
fixes #18134; registers formatBiggestFloat in vmops

strformat supports float format in VM
Diffstat (limited to 'tests/stdlib')
-rw-r--r--tests/stdlib/tstrformat.nim19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/stdlib/tstrformat.nim b/tests/stdlib/tstrformat.nim
index b44a11e68..d332e8375 100644
--- a/tests/stdlib/tstrformat.nim
+++ b/tests/stdlib/tstrformat.nim
@@ -475,15 +475,17 @@ proc main() =
 
     # Note: times.format adheres to the format protocol. Test that this
     # works:
+    when nimvm:
+      discard
+    else:
+      var dt = dateTime(2000, mJan, 01, 00, 00, 00)
+      check &"{dt:yyyy-MM-dd}", "2000-01-01"
 
-    var dt = initDateTime(01, mJan, 2000, 00, 00, 00)
-    check &"{dt:yyyy-MM-dd}", "2000-01-01"
+      var tm = fromUnix(0)
+      discard &"{tm}"
 
-    var tm = fromUnix(0)
-    discard &"{tm}"
-
-    var noww = now()
-    check &"{noww}", $noww
+      var noww = now()
+      check &"{noww}", $noww
 
     # Unicode string tests
     check &"""{"αβγ"}""", "αβγ"
@@ -558,5 +560,6 @@ proc main() =
     doAssert &"""{(if true: "'" & "'" & ')' else: "")}""" == "'')"
     doAssert &"{(if true: \"\'\" & \"'\" & ')' else: \"\")}" == "'')"
     doAssert fmt"""{(if true: "'" & ')' else: "")}""" == "')"
-# xxx static: main()
+
+static: main()
 main()