From 35cdb42e020bbb569f3fba5f94c9fc70709a7836 Mon Sep 17 00:00:00 2001 From: Konstantin Molchanov Date: Mon, 27 Mar 2017 22:08:43 +0400 Subject: [PATCH] Tests: Times: JS: Add test for timestamp persistence. --- tests/js/ttimes.nim | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/js/ttimes.nim b/tests/js/ttimes.nim index c444932900..6420c81483 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