mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Test: Added tests for rc.undo.style formatting
This commit is contained in:
parent
b33e26f24d
commit
e3ad04aa37
1 changed files with 21 additions and 0 deletions
21
test/undo.t
21
test/undo.t
|
@ -68,6 +68,27 @@ class TestUndo(TestCase):
|
|||
self.assertIn("The 'undo' command does not allow '+tag'.", err)
|
||||
|
||||
|
||||
class TestUndoStyle(TestCase):
|
||||
def setUp(self):
|
||||
self.t = Task()
|
||||
self.t("add one")
|
||||
self.t("1 modify +tag")
|
||||
|
||||
def test_undo_side_style(self):
|
||||
"""Test that 'rc.undo.style:side' generates the right output"""
|
||||
self.t.config("undo.style", "side")
|
||||
code, out, err = self.t("undo", input="n\n")
|
||||
self.assertNotRegexpMatches(out, "-tags:\s*\n\+tags:\s+tag")
|
||||
self.assertRegexpMatches(out, "tags\s+tag\s*")
|
||||
|
||||
def test_undo_diff_style(self):
|
||||
"""Test that 'rc.undo.style:diff' generates the right output"""
|
||||
self.t.config("undo.style", "diff")
|
||||
code, out, err = self.t("undo", input="n\n")
|
||||
self.assertRegexpMatches(out, "-tags:\s*\n\+tags:\s+tag")
|
||||
self.assertNotRegexpMatches(out, "tags\s+tag\s*")
|
||||
|
||||
|
||||
class TestBug634(TestCase):
|
||||
def setUp(self):
|
||||
self.t = Task()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue