dom: dom.active.tag.count is now an error when there is no open inteval

This commit is contained in:
Paul Beckingham 2016-07-16 14:22:23 -04:00
parent 6171003466
commit 1c36634e0e
2 changed files with 4 additions and 3 deletions

View file

@ -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;

View file

@ -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"""