d76f573934d1

Fix tests
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Sat, 11 Apr 2020 11:31:40 -0400
parents 2cc19f841df2
children c92a0241e9c9
branches/tags (none)
files t.py tests/editing.t tests/errors.t tests/taskdirs.t tests/tasklists.t

Changes

--- 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.
 
--- 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.
 
--- 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
--- 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
--- 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