Skip to content

Commit

Permalink
add test to lib_test.py for coverage and format
Browse files Browse the repository at this point in the history
  • Loading branch information
dpranke committed Nov 11, 2024
1 parent ff1d520 commit fcaf75f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,14 @@ def test_sample_file(self):

def test_strict(self):
# From [GitHub issue #82](https://github.com/dpranke/pyjson5/issues/82)
foo=(
'{\n'
'"key": "value\n'
'over two lines",\n'
'}'
)
self.check_fail(foo, '<string>:2 Unexpected "\n" at column 14')
self.check(foo, {'key': 'value\nover two lines'}, strict=False)
d = '{\n"key": "value\nover two lines",\n}'
self.check_fail(d, '<string>:2 Unexpected "\n" at column 14')
self.check(d, {'key': 'value\nover two lines'}, strict=False)

# Test w/ single quotes to get coverage.
d = "{\n'key': 'value\nover two lines',\n}"
self.check_fail(d, '<string>:2 Unexpected "\n" at column 14')
self.check(d, {'key': 'value\nover two lines'}, strict=False)

def test_strings(self):
self.check('"foo"', 'foo')
Expand Down

0 comments on commit fcaf75f

Please sign in to comment.