Closed mtdowling closed 11 years ago
It does pass in python, but I believe your'e correct. The inner quotes should be escaped. That would make the JSON test case:
{
"expression": "\"\\\"\\\"\\\"\"",
"result": "threequotes"
}
Interestingly enough, this tests also passes without any changes. I think the lexer in jmespath
is just too lenient. Might be worth updating the compliance tests with the notion of tests that should fail to compile. In the meantime I'll at least update the tests.
The following test does not work correctly when run using PHP. Maybe this is something to do with how PHP handles string escaping when parsing JSON.
https://github.com/boto/jmespath/blob/develop/tests/compliance/escape.json#L37
In PHP, this creates a key containing
""""
, which is not a valid jmespath identifier. It should be"\"\"\""
.For example (php -a):
Does this particular test case pass in Python?