mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
dom: dom.active.tag.count is now an error when there is no open inteval
This commit is contained in:
parent
6171003466
commit
1c36634e0e
2 changed files with 4 additions and 3 deletions
|
@ -70,7 +70,8 @@ bool domGet (
|
||||||
}
|
}
|
||||||
|
|
||||||
// dom.active.tag.count
|
// dom.active.tag.count
|
||||||
if (pig.skipLiteral (".tag.count"))
|
if (pig.skipLiteral (".tag.count") &&
|
||||||
|
latest.range.is_open ())
|
||||||
{
|
{
|
||||||
value = format ("{1}", latest.tags ().size ());
|
value = format ("{1}", latest.tags ().size ());
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -100,8 +100,8 @@ class TestDOM(TestCase):
|
||||||
|
|
||||||
def test_dom_active_tag_count_inactive(self):
|
def test_dom_active_tag_count_inactive(self):
|
||||||
"""Test dom.active.tag.count with no active track"""
|
"""Test dom.active.tag.count with no active track"""
|
||||||
code, out, err = self.t("get dom.active.tag.count")
|
code, out, err = self.t.runError("get dom.active.tag.count")
|
||||||
self.assertEqual('0\n', out)
|
self.assertIn("DOM reference 'dom.active.tag.count' is not valid.", err)
|
||||||
|
|
||||||
def test_dom_active_tag_count_zero(self):
|
def test_dom_active_tag_count_zero(self):
|
||||||
"""Test dom.active.tag.count with zero tags"""
|
"""Test dom.active.tag.count with zero tags"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue