mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lexer
- When parsing '\o/' the state Lexer::typeIdentifierEscape had no exit but a successful outcome, and looped. - Fixed test.
This commit is contained in:
parent
bb060d5ff8
commit
51f08496b5
3 changed files with 11 additions and 5 deletions
|
@ -167,6 +167,7 @@
|
|||
- TW-1424 Using a date of '1824days' (in the future) fails (thanks to Black Ops
|
||||
Testing).
|
||||
- TW-1428 Add support for color.uda.<name>.<value> rules.
|
||||
- TW-1436 Parser hangs when multiple slashes are used.
|
||||
- Removed deprecated 'echo.command' setting, in favor of the 'header' and
|
||||
'affected' verbosity tokens.
|
||||
- Removed deprecated 'edit.verbose' setting, in favor of the 'edit' verbosity
|
||||
|
|
|
@ -244,6 +244,12 @@ bool Lexer::token (std::string& result, Type& type)
|
|||
type = typeEscapeUnicode;
|
||||
shift ();
|
||||
}
|
||||
else
|
||||
{
|
||||
type = quote ? typeString : typeIdentifier;
|
||||
result += utf8_character (_n0);
|
||||
shift ();
|
||||
}
|
||||
break;
|
||||
|
||||
case typeEscape:
|
||||
|
|
|
@ -15,7 +15,7 @@ class TestBug1436(TestCase):
|
|||
self.t = Task()
|
||||
|
||||
def test_parser_hangs_with_slashes(self):
|
||||
"""Parser hangs with slashes"""
|
||||
"""Parser hangs with backslashes"""
|
||||
expected = "Cheer everyone up \o/"
|
||||
code, out, err = self.t(("add", expected))
|
||||
self.assertIn("Created task 1", out)
|
||||
|
@ -24,13 +24,12 @@ class TestBug1436(TestCase):
|
|||
self.assertIn(expected, out)
|
||||
|
||||
def test_parser_ending_escape_slash(self):
|
||||
"""Task created but not found with ending slash"""
|
||||
expected = "Use this slash \\"
|
||||
code, out, err = self.t(("add", expected))
|
||||
"""Task created but not found with ending backslash"""
|
||||
code, out, err = self.t(("add", "Use this backslash \\\\"))
|
||||
self.assertIn("Created task 1", out)
|
||||
|
||||
code, out, err = self.t(("list",))
|
||||
self.assertIn(expected, out)
|
||||
self.assertIn("Use this backslash \\", out)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue