tests: Add tests for parsing of nested quotes

This commit is contained in:
Tomas Babej 2015-03-28 14:47:59 +01:00
parent 6fe90c664e
commit 949284ba83

View file

@ -26,6 +26,10 @@ class TestParsingModstrings(object):
assert util.tw_modstring_to_args('project:"Random test" +test') == ["project:Random test", "+test"] assert util.tw_modstring_to_args('project:"Random test" +test') == ["project:Random test", "+test"]
assert util.tw_modstring_to_args("project:'Random test' +test") == ["project:Random test", "+test"] assert util.tw_modstring_to_args("project:'Random test' +test") == ["project:Random test", "+test"]
def test_modstring_to_args_with_nested_quotes(self):
assert util.tw_modstring_to_args('project:"Random\'test" +test') == ["project:Random'test", "+test"]
assert util.tw_modstring_to_args("project:'Random\"test' +test") == ["project:Random\"test", "+test"]
def test_modstring_to_args_with_esacpe(self): def test_modstring_to_args_with_esacpe(self):
assert util.tw_modstring_to_args(r'project:Random\ test +test') == ["project:Random test", "+test"] assert util.tw_modstring_to_args(r'project:Random\ test +test') == ["project:Random test", "+test"]
assert util.tw_modstring_to_args(r"project:Random\ test +test") == ["project:Random test", "+test"] assert util.tw_modstring_to_args(r"project:Random\ test +test") == ["project:Random test", "+test"]