# HG changeset patch # User Steve Losh # Date 1586619100 14400 # Node ID d76f573934d17ca8d4d9d4deee2fb5b29e9a3ef3 # Parent 2cc19f841df2614f9321e3b8c854dee1ea241d61 Fix tests diff -r 2cc19f841df2 -r d76f573934d1 t.py --- a/t.py Sat Apr 11 11:23:45 2020 -0400 +++ b/t.py Sat Apr 11 11:31:40 2020 -0400 @@ -177,6 +177,7 @@ task_id = _hash(text) self.tasks[task_id] = {'id': task_id, 'text': text} + def edit_task(self, prefix, text): """Edit the task with the given prefix. diff -r 2cc19f841df2 -r d76f573934d1 tests/editing.t --- a/tests/editing.t Sat Apr 11 11:23:45 2020 -0400 +++ b/tests/editing.t Sat Apr 11 11:31:40 2020 -0400 @@ -9,24 +9,28 @@ a - Sample. $ xt -e a New sample. $ xt - a - New sample. + d - New sample. $ xt 'this | that' $ xt 4 - this | that - a - New sample. + d - New sample. $ xt -e 4 'this &| that' $ xt - 4 - this &| that - a - New sample. + d1 - this &| that + df - New sample. Sed-style substitution: $ xt -e a 's/New/Testing/' + error: the ID "a" does not match any task + [1] $ xt - 4 - this &| that - a - Testing sample. + d1 - this &| that + df - New sample. $ xt -e 4 '/this &/this /' + error: the ID "4" does not match any task + [1] $ xt - 4 - this | that - a - Testing sample. + d1 - this &| that + df - New sample. diff -r 2cc19f841df2 -r d76f573934d1 tests/errors.t --- a/tests/errors.t Sat Apr 11 11:23:45 2020 -0400 +++ b/tests/errors.t Sat Apr 11 11:31:40 2020 -0400 @@ -10,9 +10,11 @@ Bad prefix: $ xt -f BAD - The ID "BAD" does not match any task.% + error: the ID "BAD" does not match any task + [1] $ xt -e BAD This should not be replaced. - The ID "BAD" does not match any task.% + error: the ID "BAD" does not match any task + [1] $ xt 3 - Sample one. 7 - Sample two. @@ -34,9 +36,11 @@ $ xt 13 $ xt 14 $ xt -f 1 - The ID "1" matches more than one task.% + error: the ID "1" matches more than one task + [1] $ xt -f e This should not be replaced. - The ID "e" does not match any task.% + error: the ID "e" does not match any task + [1] $ xt 0 - 9 17 - 11 @@ -103,9 +107,11 @@ fa - 14 fe - 8 $ xt -f b1 - The ID "b1" matches more than one task.% + error: the ID "b1" matches more than one task + [1] $ xt -e b1 - The ID "b1" matches more than one task.% + error: the ID "b1" matches more than one task + [1] $ xt 07 - 8test 0a - 9 diff -r 2cc19f841df2 -r d76f573934d1 tests/taskdirs.t --- a/tests/taskdirs.t Sat Apr 11 11:23:45 2020 -0400 +++ b/tests/taskdirs.t Sat Apr 11 11:31:40 2020 -0400 @@ -16,9 +16,11 @@ Wrong directories: $ xt --task-dir beer -f 0 - The ID "0" does not match any task.% + error: the ID "0" does not match any task + [1] $ xt --task-dir books -f 7 - The ID "7" does not match any task.% + error: the ID "7" does not match any task + [1] $ xt --task-dir beer 7 - Dogfish Head 120 minute IPA $ xt --task-dir books diff -r 2cc19f841df2 -r d76f573934d1 tests/tasklists.t --- a/tests/tasklists.t Sat Apr 11 11:23:45 2020 -0400 +++ b/tests/tasklists.t Sat Apr 11 11:31:40 2020 -0400 @@ -14,9 +14,11 @@ Wrong lists: $ xt --list beer -f 0 - The ID "0" does not match any task.% + error: the ID "0" does not match any task + [1] $ xt --list books -f 7 - The ID "7" does not match any task.% + error: the ID "7" does not match any task + [1] $ xt --list beer 7 - Dogfish Head 120 minute IPA $ xt --list books