mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
Fix getTracked() when last interval is empty
This commit is contained in:
parent
4e08bcca4d
commit
fef522c53d
2 changed files with 16 additions and 8 deletions
10
test/ids.t
10
test/ids.t
|
@ -48,6 +48,16 @@ class TestIds(TestCase):
|
|||
self.assertIn(' @1 ', out)
|
||||
self.assertIn(' @2 ', out)
|
||||
|
||||
def test_latest_interval_included_when_empty(self):
|
||||
"""Count IDs when the last interval is empty
|
||||
Include the last interval in getTracked() even if it is a
|
||||
zero-width interval and there are other, earlier intervals.
|
||||
"""
|
||||
self.t("track 2018-01-01 - 2018-01-01")
|
||||
self.t("track 2018-01-02 - 2018-01-02")
|
||||
code, out, err = self.t("move @2 2018-01-03")
|
||||
self.assertIn('Moved @2 to 2018-01-03T00:00:00', out)
|
||||
|
||||
def test_should_fail_on_zero_id(self):
|
||||
code, out, err = self.t.runError("delete @0")
|
||||
self.assertIn("'@0' is not a valid ID.", err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue