summary refs log tree commit diff stats
path: root/tests/js
diff options
context:
space:
mode:
authorKonstantin Molchanov <moigagoo@live.com>2017-03-27 22:08:43 +0400
committerKonstantin Molchanov <moigagoo@live.com>2017-03-27 22:08:43 +0400
commit35cdb42e020bbb569f3fba5f94c9fc70709a7836 (patch)
tree865450e529e3763fa6f3bd173076686d1434ec42 /tests/js
parentcc9d282348bf878a0a68d64c0c0df80253639aed (diff)
downloadNim-35cdb42e020bbb569f3fba5f94c9fc70709a7836.tar.gz
Tests: Times: JS: Add test for timestamp persistence.
Diffstat (limited to 'tests/js')
-rw-r--r--tests/js/ttimes.nim10
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/js/ttimes.nim b/tests/js/ttimes.nim
index c44493290..6420c8148 100644
--- a/tests/js/ttimes.nim
+++ b/tests/js/ttimes.nim
@@ -12,6 +12,14 @@ block yeardayTest:
   # check if yearday attribute is properly set on TimeInfo creation
   doAssert fromSeconds(2147483647).getGMTime().yearday == 18
 
-block timezoneTest:
+block localTimezoneTest:
   # check if timezone is properly set durint Time to TimeInfo conversion
   doAssert fromSeconds(2147483647).getLocalTime().timezone == getTimezone()
+
+block timestampPersistenceTest:
+  # check if timestamp persists during TimeInfo to Time conversion
+  const
+    testString = "2017-03-21T12:34:56+04:00"
+    fmt = "yyyy-MM-dd'T'HH:mm:sszzz"
+
+  doAssert $testString.parse(fmt) == testString