Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow backslash-escaped special characters in double-quoted strings (#700) #703

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add tests to show conformance with YAML 1.2.1 spec section 5.7
jmknoble committed Dec 29, 2024
commit 83ef4c2a99a4e6e9bbd3d1406ae237909e1e8b41
6 changes: 6 additions & 0 deletions tests/rules/test_quoted_strings.py
Original file line number Diff line number Diff line change
@@ -481,6 +481,12 @@ def test_only_when_needed_special_characters(self):
self.check('---\n'
'k1: "\\u001b"\n',
conf)
self.check('---\n'
"k1: '\\u001b'\n",
conf, problem=(2, 5))
self.check('---\n'
'k1: \\u001b\n',
conf)
self.assertRaises(yaml.reader.ReaderError, self.check,
'---\n'
'k1: "\u001b"\n',