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>
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>
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 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>
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>
It was possible for `summary` command, when used with the :all hint, to
skip over any intervals that start later than the first interval in the
database.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
- It seems that recent changes made the `stop` command faster such that these tests aborted with "The end of a date range must be after the start."
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
I would like to use TempDir for the Datafile test in order to cleanup
any datafiles created as part of the test.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Move the adjustment of a new open interval that is enclosed by the
current open interval into the validation processing, where the other
overlap resolution takes place.
This will allow the start command to honor the :adjust flag when
starting a new interval that predates the current open interval.
Closes#326
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>
It was possible previously to start an interval with a filter earlier
than the current filter, and if the tags matched, the command would
report success without actually moving the start time.
Signed-off-by: Shaun Ruffell <sruffell@sruffell.net>
- Add tests for JSON output
- Separate different test scenarios
- Optimize JSON output in `TagInfoDatabase::toJson ()`
- Closes#325
Signed-off-by: Thomas Lauf <thomas.lauf@tngtech.com>