mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
DOM: tw.syncneeded should be 0/1, not false/true
This commit is contained in:
parent
06dc1f6c42
commit
28030cfc39
2 changed files with 6 additions and 6 deletions
|
@ -91,12 +91,12 @@ bool getDOM (const std::string& name, Variant& value)
|
||||||
{
|
{
|
||||||
if (name == "tw.syncneeded")
|
if (name == "tw.syncneeded")
|
||||||
{
|
{
|
||||||
value = Variant (false);
|
value = Variant (0);
|
||||||
for (const auto& line : context.tdb2.backlog.get_lines ())
|
for (const auto& line : context.tdb2.backlog.get_lines ())
|
||||||
{
|
{
|
||||||
if (line[0] == '{')
|
if (line[0] == '{')
|
||||||
{
|
{
|
||||||
value = Variant (true);
|
value = Variant (1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -286,16 +286,16 @@ class TestDOMSync(TestCase):
|
||||||
""" DOM tw.syncneeded --> false """
|
""" DOM tw.syncneeded --> false """
|
||||||
code, out, err = self.t("_get tw.syncneeded")
|
code, out, err = self.t("_get tw.syncneeded")
|
||||||
self.assertEqual(code, 0)
|
self.assertEqual(code, 0)
|
||||||
self.assertIn("false", out)
|
self.assertIn("0", out)
|
||||||
self.assertNotIn("true", out)
|
self.assertNotIn("1k", out)
|
||||||
|
|
||||||
def test_dom_tw_syncneeded_true(self):
|
def test_dom_tw_syncneeded_true(self):
|
||||||
""" DOM tw.syncneeded --> true """
|
""" DOM tw.syncneeded --> true """
|
||||||
self.t("add foo")
|
self.t("add foo")
|
||||||
code, out, err = self.t("_get tw.syncneeded")
|
code, out, err = self.t("_get tw.syncneeded")
|
||||||
self.assertEqual(code, 0)
|
self.assertEqual(code, 0)
|
||||||
self.assertNotIn("false", out)
|
self.assertNotIn("0", out)
|
||||||
self.assertIn("true", out)
|
self.assertIn("1", out)
|
||||||
|
|
||||||
|
|
||||||
class TestDOMDirectReferencesOnAddition(TestCase):
|
class TestDOMDirectReferencesOnAddition(TestCase):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue