PICARD-2214: Fix exception if script ends with backslash

This commit is contained in:
Philipp Wolfer
2021-05-28 12:02:18 +02:00
parent 3ea4f6419b
commit c80e7ea758
2 changed files with 8 additions and 0 deletions

View File

@@ -1010,6 +1010,12 @@ class ScriptParserTest(PicardTestCase):
def test_char_escape(self):
self.assertScriptResultEquals(r"\n\t\$\%\(\)\,\\", "\n\t$%(),\\")
def test_char_escape_unexpected_char(self):
self.assertRaises(ScriptSyntaxError, self.parser.eval, r'\x')
def test_char_escape_end_of_file(self):
self.assertRaises(ScriptEndOfFile, self.parser.eval, 'foo\\')
def test_raise_unknown_function(self):
self.assertRaises(ScriptUnknownFunction, self.parser.eval, '$unknownfn()')