Commit Graph

37 Commits

Author SHA1 Message Date
contrapunctus 5d5b423c59 Implement multi-backend tests
Reorganize plist backend methods
Address some failing tests for plist backend methods
2022-01-03 02:11:49 +05:30
contrapunctus 909be83e3a Suppress load-time error about nonexistent file 2021-12-27 14:06:42 +05:30
contrapunctus c87b8a0a4d Add tests for case of file without records 2021-12-27 14:06:09 +05:30
contrapunctus 28f120f94b Reorder tests 2021-12-26 19:36:44 +05:30
contrapunctus 283efd5a03 Reinstate test data as list of plists 2021-12-26 14:29:51 +05:30
contrapunctus 01d11ba5d2 Add tests for backend protocol 2021-12-23 20:33:22 +05:30
contrapunctus 0dd4e775f5 Remove old test data file 2021-12-23 20:29:08 +05:30
contrapunctus 2ac54f418a Merge branch 'dev' into plist-group-handle-split-plists 2021-12-04 22:45:12 +05:30
contrapunctus 17b19d79f5 Create plists-split-p 2021-12-02 17:42:45 +05:30
contrapunctus 311c3b0a1b Add test case 2021-12-01 17:09:08 +05:30
contrapunctus 6be3849136 doc: add TODO items and failing test case 2021-11-30 21:33:05 +05:30
contrapunctus 37bc29d923 fix: pretty printer behaviour for nested list values 2021-11-30 18:10:34 +05:30
contrapunctus d13362f6bf Move tests into chronometrist-tests.org 2021-11-22 17:01:57 +05:30
contrapunctus b92f8b9c25 Write tests for plist-p, plist-group-p 2021-11-18 02:16:45 +05:30
contrapunctus 7a17ed14a7 Rename functions; implement to-hash-table for plist-group
task-records -> task-records-for-date
active-time-one-day -> active-time-on

New generic - latest-date-records
Removed generic active-time
2021-10-30 00:00:35 +05:30
contrapunctus 4f0b0c0171 Use to-list + cl-loop instead of cl-loop wrapper macros 2021-10-29 00:40:54 +05:30
contrapunctus 71ead83538 Rename test file 2021-10-21 14:57:33 +05:30
contrapunctus d10684f817 Add task-records test; restructure tests 2021-10-21 14:56:04 +05:30
contrapunctus 9eb9a05dd7 Make current-task a regular function 2021-10-21 14:33:50 +05:30
contrapunctus 8fd4d19c82 convert tests to Org LP; move hash table into backend object
* create generic functions reset-internal, on-change, backend-empty-p, memory-layer-empty-p
* move most of refresh-file to on-change method
2021-10-20 19:31:11 +05:30
contrapunctus 1aa1a30291 Write tests for loop-records; move generic function 2021-10-15 07:39:59 +05:30
contrapunctus 31db47f46f Remove local variables from test file 2021-10-14 10:53:22 +05:30
contrapunctus 052bc23b17 Write backend tests 2021-10-14 09:21:28 +05:30
contrapunctus f3e78c1fde [literate] Update other `require` calls 2021-02-15 13:40:35 +05:30
contrapunctus 010b828dbc Fix lone paren; add ERT tests 2020-11-07 10:53:44 +05:30
contrapunctus 8b16cfbe1f Fix indentation of plist keyword after a plist as value; update tests 2020-11-06 14:06:26 +05:30
contrapunctus 557780afb5 plist-pp - add tests, TODO items 2020-09-08 11:05:33 +05:30
contrapunctus 7a2b491a3c key-history-populate - change signature
Move description of key-history from the docstring of
key-history-populate to that of key-history.
2020-08-29 14:14:58 +05:30
contrapunctus 8e61cff721 value-history-populate - change signature and return value; add test
Local variables have also been renamed, to describe their purpose and
not so much their type.

ht-history-prep now returns the new value of the hash table.
2020-08-29 00:37:35 +05:30
contrapunctus 872825a571 tags-history-populate - change signature, return value; add tests 2020-08-28 19:30:53 +05:30
contrapunctus ee85d171e4 Fix key history bug where only one item was being stored; add tests
1. We were using gethash on chronometrist-events rather than
   chronometrist-key-history 🤦‍♀
2. If an event has more than one key, determining the value of
   old-keys in the outer loop meant that the first key would be
   replaced by the second.

We also rename local variables so they tell us what objects they
represent, and reindent the code so it is more condensed.
2020-06-26 16:18:55 +05:30
contrapunctus 2a6829c0d3 Fix byte compiler errors; add tests for task-time-one-day 2020-05-21 01:44:11 +05:30
contrapunctus c190ced000 Replace time values with integer seconds
1. chronometrist-events->time-list -> chronometrist-events->ts-pairs,
now returns a list of ts pairs. Rewritten using cl-loop.
2. chronometrist-time-list->sum-of-intervals ->
chronometrist-ts-pairs->durations, now returns a list of durations in
integer seconds.
3. A critical bug in chronometrist-iso-timestamp->ts was discovered -
we were passing the output of encode-time (via
parse-iso8601-time-string) to (make-ts :unix ...) - the latter expects
a number, not a list.
4. Both chronometrist-task-time-one-day and
chronometrist-events->ts-pairs were checking if a task was still
ongoing. Removed the redundant checking from the former.
5. Updated docstring of chronometrist-active-time-one-day
6. chronometrist-statistics-count-average-time-spent rewritten using
cl-loop

Also, when trying to write tests, I realized that
chronometrist-events-clean has long been removed. Removed a reference
to it from the manual and a docstring.
2020-05-20 16:45:29 +05:30
contrapunctus 98627c12f6 Rename tests for renamed function iso-date->ts 2020-05-19 15:33:42 +05:30
contrapunctus fd4dc7008b Create make-ts-date
The tests for previous-week-start now pass.
2020-05-17 09:49:14 +05:30
contrapunctus bfddc66ff6 Rename chronometrist-sexp -> chronometrist-key-values
-sexp will be used for the current backend.
2020-05-14 07:32:49 +05:30
contrapunctus b3bf2bf8ed Scratch code for new s-exp format 2019-09-04 09:44:08 +05:30