summary refs log tree commit diff stats
path: root/tests/stdlib/ttime.nim
Commit message (Collapse)AuthorAgeFilesLines
* Parse 'Z' as valid timezone if offset is expectedFelix Krause2016-11-141-0/+4
|
* Improved `-`; fixed testsFelix Krause2016-11-141-2/+2
| | | | | | * added prefix `-` operator for TimeInterval * improved `-` for both TimeInterval and TimeInfo * Fixed a DST test
* Fixed daylight saving timeFelix Krause2016-11-141-1/+22
| | | | | | | | | * When formatting timezone, substract 1 hour from timezone when isDST * Do not depend DST in current timezone when parsing arbitrary date because formatted timestamps are never in DST. * On the way, removed an unnecessary line in parsing code which could cause bugs. * Added DST tests
* Fixed timezone rendering, added testFelix Krause2016-11-101-0/+12
|
* Merge pull request #5002 from goldenreign/time-compare-nosideeffectAndreas Rumpf2016-11-071-0/+11
|\ | | | | Add 'noSideEffect' pragma for Time type's operators. Fixes #4981
| * Add 'noSideEffect' pragma for Time type's operatorsgoldenreign2016-11-071-0/+11
| |
* | Use ISO 8601 format for times.`$`. Fixed tests.Felix Krause2016-11-011-51/+66
| | | | | | | | | | | | * `$` now uses format() with explicit time zone. * Fixed errors in rendering "z", "zz" and "zzz" * Updated tests
* | Removed tzname because it's brokenFelix Krause2016-11-011-12/+12
|/ | | | | | | * No mapping between TimeInfo.tzname and TimeInfo.timezone * tzname of time.h is not well-defined, may have almost arbitrary length, and localization may differ * Code used hardcoded "UTC" string
* Fix #4922, bug in times.parse, mishandling DST.Jonathan Bernard2016-10-211-0/+16
|
* Bugfix for times.initInterval (issue #4889)Jonathan Bernard2016-10-121-1/+8
| | | | | | | | | | | | | | | | | | | | | | | `initInterval` had logic to calculate and carry overflowed fields (65 seconds turns into 5 seconds and carries 1 minute). However, we were not including that carried value when we recalculate the carry over for the next period of time.So if you had, for example, 3600 seconds, we carried 60 minutes into the minutes calculation, but when we calculated how much we should carry into the hours value we only considered what the user originally supplied for the minutes field, and forgot to include those 60 carried minute. So, for example, with the previous implementation this was true: `seconds(60 * 60 * 24) == seconds(0)` Or, as failing tests: ```nimrod import times assert seconds(60 * 60 * 24) != seconds(0) assert seconds(60 * 60 * 24) == days(1) ```
* Improved times testsFelix Krause2016-08-211-38/+32
| | | | | | | * Added check for yearday * Changed some test dates to check different equivalence classes of yearday (before leap day, at leap day, after february in leap year, after february in non-leap year)
* Fixed TimeInterval bug.Dominik Picheta2016-01-081-0/+5
|
* Fixed ttime test. Improved docs in times module.Dominik Picheta2016-01-081-1/+0
|
* add timeinterval helping functions as per issue #3609JamesP2015-12-081-37/+57
| | | | | | | | | | add tests to ttime.nim for timeinterval add/subtract functionality Changed assert to doAssert in ttime.nim Added extra tests to ttime.nim Removal of singular help procs for working with TimeIntervals Added TimeIin proc toSeconds(a: TimeInfo, interval: TimeInterval) where subtracting a year gave wrong results Add overflow of units on initInterval eg, 65 seconds is 5 seconds and 1 minute
* add assertion tests from times module to ttime.nim test file in tests\stdlibJamesP2015-12-011-2/+121
|
* tests: Trim .nim files trailing whitespaceAdam Strzelecki2015-09-041-6/+6
| | | | via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
* new tester; all tests categorizedAraq2014-01-131-0/+6