test: Matching escaped and unescaped keys #70
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites checklist
What is the purpose of this pull request?
Ensure that escaped and unescaped keys of objects that evaluate to the same string still trigger rules that prevent duplicate keys.
What changes did you make? (Give an overview)
Added tests with
o
replaced with\\u006f
in strategic places. Note that the double-backslash is necessary so that the JSON parser is processing the backslash, not the JS parser running the tests.Related Issues
Refs #68
Is there anything you'd like reviewers to focus on?
Note that this is affected by
humanwhocodes/momoa#164
in the sense that in JSON5 mode, unquoted escaped
keys are not yet unescaped in the same was as
all other keys, and will not trigger this lint
yet. When the momoa issue is fixed, released, and we have updated to that version, uncomment the
last test in no-duplicate-keys.test.js.
Suggest that we create a separate issue in this
repo to track that change.