I left some unused varaibles in a new test functions after copy-paste.
This addresses @laufts comments on #423.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
It is not sufficient to stop looking for matching intervals if the
interval start time is before the filter. We really want to make sure
that we pick up any intervals that intersect with the filter.
Fixes bug introduced in (a98bd14 "Simplify getIntervalsById and
getTracked") as part of #423.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
The intent here is to make similar the implementations of
getIntervalsById and getTracked, since they are both gathering a
collection of intervals from the database, but they are just using a
different criteria for which ones to pull.
This also eliminates the use of std::deque.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This also installs asciidoctor 2.0.15 explicitly so that if the latest
is changed upstream the update-alternatives line will not break.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Eliminates extra noise in the debug output. I.e. from #422 the original
report contained:
>> 2021-05.data: Deleted inc 20210511T161243Z # "TRACKER-6145"
>> 2021-05.data: Added inc 20210511T161243Z # "TRACKER-6145"
Which isn't doing anything.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This fixes an error where the latest interval, a non-synthetic interval,
is added to the synthetic array (and marked synthetic) if flatten() is
otherwise not able to convert it to a group of synthetic intervals.
When modify was attempting to edit this interval, it would fail since
synthetic intervals should not be written to the database unless the
database is being flattened and timewarrior believed the interval to be
modified was synthetic.
Closes#422
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
The Interval::dump() method will show if intervals are synthetic or not,
which can be useful when trying to determine why a comparison is
failing.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
The JSON library in libshared has functions to esacpe JSON's special
characters, but they are not used by default.
Closes#416
Related to #261
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
The bitwise or, `|` had higher precendence than the `>` test. Fixes the
following error:
not ok 4 - summary.t: Summary should work with :all hint
# FAIL: AssertionError on file test/summary.t line 213 in test_with_all_hint: 'self.assertIn("""':
# '
# Wk Date Day ID Tags Start End Time Total
# -- ---------- --- -- ---- -------- -------- ------- -------
# W13 2021-04-04 Sun @3 FOO 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-05 Mon @2 BAR 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-06 Tue @1 BAZ 10:00:00 11:00:00 1:00:00 1:00:00
#
# 3:00:00
# ' not found in '
# Wk Date Day ID Tags Start End Time Total
# --- ---------- --- -- ---- -------- -------- ------- -------
# W13 2021-04-04 Sun @3 FOO 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-05 Mon @2 BAR 10:00:00 11:00:00 1:00:00 1:00:00
# W14 2021-04-06 Tue @1 BAZ 10:00:00 11:00:00 1:00:00 1:00:00
#
# 3:00:00
#
# '
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
The help.t test wants to verify that some of the man pages exist.
Therefore we need to make sure the documentation is built, otherwise:
$ git clean -ffdx .
$ cmake -DCMAKE_BUILD_TYPE=Debug .
$ make test
Will fail some of the help.t tests.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
This replaces the generation of man pages on project setup
by a on-demand generation via asciidoctor.
An exception are the man pages for the commands `day`, `month`, and `week`
which are simply redirects to the man page `timew-chart.1`. Those are now
static files in the Timewarrior repository.
A CMake find module to detect asciidoctor was added.
If asciidoctor is found, the targets `doc`, `man1`, and `man7` are created.
Those targets are also added to the default build target.
If asciidoctor is not available, the target `doc` is available, but it only
emits a message to install asciidoctor first.
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Compatibility with CMake < 2.8.12 will be removed from a future version of CMake.
According to our test images all supported distributions have CMake > 3
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
See #380. We will include the test suite in the release tarball so the Gentoo maintainers can run it and report back.
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
Python added Thread.is_alive() in 2.6 and removed Thread.isAlive() in
3.9.
This change is needed to run the tests with Python 3.9.
https://bugs.python.org/issue37804
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>