"expected '\"' but found '{}'".format(value))
bare_quoted_string = BareQuotedString()
value = value[1:]
- if value[0] == '"':
+ if value and value[0] == '"':
token, value = get_qcontent(value)
bare_quoted_string.append(token)
while value and value[0] != '"':
self._test_get_x(parser.get_bare_quoted_string,
'""', '""', '', [], '')
+ def test_get_bare_quoted_string_missing_endquotes(self):
+ self._test_get_x(parser.get_bare_quoted_string,
+ '"', '""', '', [errors.InvalidHeaderDefect], '')
+
def test_get_bare_quoted_string_following_wsp_preserved(self):
self._test_get_x(parser.get_bare_quoted_string,
'"foo"\t bar', '"foo"', 'foo', [], '\t bar')