summary refs log tree commit diff stats
path: root/tests/stdlib/ttimes.nim
Commit message (Collapse)AuthorAgeFilesLines
* remove some noises in tests (#16448)flywind2020-12-271-51/+51
|
* testament: error instead of silently ignore invalid targets; remove ↵Timothee Cour2020-12-141-1/+1
| | | | | | | | | | | pointless alias target vs targets; document matrix; DRY (#16343) * testament: error instead of silently ignore invalid targets * s/target/targets/ * fix test; refs #16344 * address comments * Update testament/specs.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* unittest: use defines instead of env vars (#16165)Timothee Cour2020-12-101-6/+0
| | | | | | | | | * unittest: use defines instead of env vars * use defines in testament * fixup Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Make the fields of `times.DateTime` private (#14197)Oscar Nihlgård2020-05-061-9/+20
| | | | | * Make the fields of `times.DateTime` private * PR fixes
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-2/+2
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* fix https://github.com/nim-lang/RFCs/issues/211: `var a: DateTime` compiles ↵Timothee Cour2020-04-181-0/+15
| | | | | | | and is usable (#14002) [backport:1.2] * fix https://github.com/nim-lang/RFCs/issues/211: `var a: DateTime` works * assertValidDate checks for sentinel month
* faster CIs (#13803)Miran2020-03-301-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ttables: smaller table, 5x speedup * thavlak: less iterations, less loops; 30% speedup * tasyncclosestall: shorter timeout; 35% speedup * gcleak4: less iterations, 2x speedup * ttimes: remove deprecated stuff * tdangerisrelease: remove cpp backend, 3x speedup * tfrexp1: smaller range, 2x speedup * trtree: fix warnings, less iterations, 6x speedup * tasyncawait_cyclebreaker: smaller swarm size; 2x speedup * trealloc: smaller number of iterations; 10x speedup * towned_binary_tree: less iterations, 4x speedup * tclosure: remove unused code, less iterations; 2x speedup * twaitany: less durations; 1.4x speedup * tasync_misc: less iterations, 2x speedup * t8535: smaller sleep, 1.5x speedup * tmanyjoin: smaller sleep, 2x speedup * t12221: shorter sleeps, removed two slower tests; 1.6x speedup * tfuturestream: smaller sleep; 1.5x speedup * growobjcrash: less iterations; 2x speedup * ttryrecv: smaller sleep; 1.5x speedup * treusetvar: less threads; 2x speedup * delete tthreadanalysis2, basically a duplicate of tthreadanalysis * t7758: less iterations, 1.5x speedup * tasyncawait: smaller swarm, less messages; 1.5x speedup * tjsandnativeasync: smaller sleep, 1.5x speedup * tpendingcheck: smaller sleep, 1.5x speedup * remove rodfiles test category * move tseq from its own category to 'collections' category * remove unneeded tests and helpers from 'assert' category * stdlib: merge tbitops2 into tbitops * remove 'trepr2' from 'stdlib' cat * merge 'tstreams' into one file * remove 'tinefficient_const_table' from 'ccbugs' cat * merge 'tcollections_to_string' into 'tcollections' * tblocking_channel: smaller sleep, small speedup * tconvexhull: less iterartions; 1.2x speedup * merge 'tdeepcopy2' into 'tdeepcopy' * merge 'tdisjoint_slice2' into 'tdisjoint_slice1' * tmissing_deepcopy: smaller sequence * tsendtwice: smaller arrays; 5x speedup * remove 'tindexerrorformatbounds' * disable multimethod tests * remove 'gc:none' and 'refc' without 'd:useRealtimeGC' from gc tests * koch.nim: bootstrap just with '-d:release', no need for 'csource' * add github workflow for documentation * testament: no need for 8 sub-second decimals
* fixes #13543 and added times.isLeapDay (#13547)Timothee Cour2020-03-011-3/+7
|
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-2/+2
|
* Allow for locale-based parsing/formatting of dates (#11170)Matt Haggard2019-05-081-0/+27
| | | | | | | | | | | | | | | * Allow for locale-based parsing/formatting of dates * Updates based on review feedback of PR 11170 DateTimeLocale arrays are now indexed by Month and WeekDay enums. More sane date used for testing. Documentation newline. Case change of DefaultLocale (and make it public) * Add changelog entry for DateTimeLocale addition to times module * Use pattern symbols for DateTimeLocale attribute names
* Replace the duration conversion procs with new improved ones (#10710)Oscar Nihlgård2019-02-191-0/+9
|
* New implementation of times.between (#10523)Oscar Nihlgård2019-02-061-35/+138
| | | | | | | | * Refactor ttimes * New implementation of times.between * Deprecate times.toTimeInterval
* Fix spelling errors (#10379)Federico Ceratto2019-01-191-1/+1
|
* Don't use parseutils.parseInt in the times module (#10028)Oscar Nihlgård2018-12-221-0/+11
|
* require errormsg to be specified before file.Arne Döring2018-12-111-7/+4
|
* times - remove unneeded negative sign when parsing formats z and zz (#9631)pgkos2018-11-061-0/+9
| | | | | | * fix wrong utcoffset sign for formats z and zz * add tests for the timezone offset formats
* Fix tests on NixOS (#9209) (#9285)xzfc2018-10-101-1/+1
| | | | | | | * Replace `/bin/sleep` with just `sleep`, i.e. use environment variable `$PATH` to locate binary. * Replace `/usr/share/zoneinfo` with `$TZDIR` when it is defined, fallback to hardcoded path otherwise. This is the same behavior that Glibc2 normally have, see man 3 tzset.
* Cleanup ttimes (#8714)Oscar Nihlgård2018-08-221-101/+72
| | | | | | * Refactor fromWinTime * Cleanup ttimes
* times.Timezone changes (#8527)Oscar Nihlgård2018-08-171-24/+6
| | | | | | | | | | * Use floorDiv in times.nim * New implementation of times.Timezone * Tweak doc comments * Fix typo
* New implementations of times.parse & times.format (#8094)Oscar Nihlgård2018-07-091-61/+149
|
* Merge pull request #7624 from skilchen/fix-issue7620Dominik Picheta2018-05-031-0/+6
|\ | | | | there is no hour 0 in am/pm time (see #7620)
| * there is no hour 0 in am/pm timeskilchen2018-04-161-0/+6
| |
* | Rename `Time.nanoseconds` to `nanosecond` (#7673)Oscar Nihlgård2018-04-251-2/+6
| | | | | | | | | | | | * Rename `Time.nanoseconds` to `nanosecond` * Fix bug with Duration comparision
* | Add `fromWinTime` and deprecate `unixTimeToWinTime`/`winTimeToUnixTime` (#7641)Oscar Nihlgård2018-04-191-1/+8
|/
* Timeinterval optimization (#7608)Oscar Nihlgård2018-04-161-21/+24
| | | | | | * TimeInterval optimization * Fix typo in `$`(Duration)
* Sub second time resolution (#6978)Oscar Nihlgård2018-04-131-26/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add deprecation warnings to recently deprecated procs * Fix bad usage of the times module * Introduce sub second resolution * Fix usage of C's time() * Switch to nanosecond resolution * Make Time & Duration opaque again and fix some errors * Change back to TimeInterval for shorthands * Fix JS test * Fix build error for windows * Undeprecate epochTime * Documentation and minor changes * Lots of bugfixes and doc comments * Attempt to make travis & appveyor green * Fix edge cases for dealing with the local timezone * Workaround JS backend overflow/underflow bug * Use better workaround for not knowing the size of time_t * Use all available timezones for tests * Fix indentation * Add procs for accessing the fractional part of a duration * Order time units from smallest to largest since it makes more sense * Include months and years in `TimeUnit` * Review fix
* Comparing datetimesdata-man2018-04-011-1/+9
|
* Fix date parsing for a bad inputsdata-man2018-02-191-0/+49
|
* Allow timezone procs to be closuresOscar Nihlgård2018-01-051-0/+24
|
* Better times module (#6552)GULPF2017-12-181-156/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * First work on better timezones * Update tests to new api. Removed tests for checking that `isDst` was included when formatting, since `isDst` no longer affects utc offset (the entire utc offset is stored directly in `utcOffset` instead). * Deprecate getLocaltime & getGmTime * Add `now()` as a shorthand for GetTIme().inZone(Local) * Add FedericoCeratto's timezone tests (#6548) * Run more tests in all timezones * Make month enum start at 1 instead of 0 * Deprecate getDayOfWeekJulian * Fix issues with gc safety * Rename TimeInfo => DateTime * Fixes #6465 * Improve isLeapYear * FIx handling negative adjTime * Cleanup: - deprecated toSeconds and fromSeconds, added fromUnix and toUnix instead (that returns int64 instead of float) - added missing doc comments - removed some unnecessary JS specific implementations * Fix misstake in JS `-` for Time * Update usage of TimeEffect * Removed unecessary use of `difftime` * JS fix for local tz * Fix subtraction of months * Fix `days` field in `toTimeInterval` * Style and docs * Fix getDayOfYear for real this time... * Fix handling of adding/subtracting time across dst transitions * Fix some bad usage of the times module in the stdlib * Revert to use proper time resoultion for seeding in random.nim * Move deprecated procs to bottom of file * Always use `epochTime` in `randomize` * Remove TimeInterval normalization * Fixes #6905 * Fix getDayOfWeek for year < 1 * Export toEpochDay/fromEpochDay and change year/month/monthday order * Add asserts for checking that the monthday is valid * Fix some remaining ambiguous references to `Time` * Fix ambiguous reference to Time
* Fix countLeapYearsOscar Nihlgård2017-10-101-0/+6
|
* Add dst formatting tests (#6468)GULPF2017-10-101-0/+237
* Rename ttime.nim => ttimes.nim * Add formating tests for DST, closes #3199 * Make appveyor green * Remove broken test