mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
#157: Change error message for non-positive IDs
This commit is contained in:
parent
48aa9cfdc0
commit
616ca4b884
2 changed files with 5 additions and 3 deletions
|
@ -412,9 +412,11 @@ void CLI::identifyIds ()
|
|||
int digits;
|
||||
if (pig.skipLiteral ("@") &&
|
||||
pig.getDigits (digits) &&
|
||||
pig.eos () &&
|
||||
digits > 0)
|
||||
pig.eos ())
|
||||
{
|
||||
if (digits <= 0)
|
||||
throw format ("'@{1}' is not a valid ID.", digits);
|
||||
|
||||
a.tag ("ID");
|
||||
a.attribute ("value", digits);
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ class TestIds(TestCase):
|
|||
|
||||
def test_should_fail_on_zero_id(self):
|
||||
code, out, err = self.t.runError("delete @0")
|
||||
self.assertIn("IDs must be specified.", err)
|
||||
self.assertIn("'@0' is not a valid ID.", err)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue