-
Notifications
You must be signed in to change notification settings - Fork 10
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
test: add serialization tests #237
Conversation
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was changed on this line?
c8e2622
to
c92a465
Compare
I is easier to review this PR using comparison with #236 |
c92a465
to
4910482
Compare
@@ -0,0 +1,5 @@ | |||
'use strict'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this in test/fixtures/json5
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I placed it here because they are tests for json5 specification, byt i guess I should have placed them in test/fixtures/todo/json5/
9fa3821
to
300f718
Compare
serialized: '{$:\'dollar\',_$_:\'multiple symbols\'}' | ||
}, | ||
{ | ||
name: 'object with unicode unquoted key', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"unicode" should be capitalized here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it is better to name this test case "object with identifier name, containing non-latin Unicode literals, as a key".
serialized: '{42:true}' | ||
}, | ||
{ | ||
name: 'object with unquoted keys', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this one should be called "object with identifier names as keys".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name was taken from corresponding test for JSON5 parsing test: test/fixtures/json5/objects/unquoted-keys.json5
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nechaido, yes, and these JSON5 tests are imported while you are creating new tests, in my opinion, it is better to name them correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@belochub ok
|
||
module.exports = [ | ||
{ | ||
name: 'string with inline comment like substring', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This name is a bit misleading here.
|
||
module.exports = [ | ||
{ | ||
name: 'string with substring like inline comment', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be called "string containing inline comment".
}, | ||
{ | ||
name: 'object with identifier name' + | ||
', containing non-latin Unicode literals, as a key', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You shouldn't start a new line with a comma.
c41a64c
to
411ba26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
411ba26
to
9c6d914
Compare
9c6d914
to
1c088f7
Compare
@aqrln ping. |
PR-URL: #237 Reviewed-By: Mykola Bilochub <nbelochub@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Landed in 3807446. |
PR-URL: #237 Reviewed-By: Mykola Bilochub <nbelochub@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
PR-URL: #237 Reviewed-By: Mykola Bilochub <nbelochub@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
PR-URL: metarhia/jstp#237 Reviewed-By: Mykola Bilochub <nbelochub@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
PR-URL: metarhia/jstp#237 Reviewed-By: Mykola Bilochub <nbelochub@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
PR-URL: metarhia/jstp#237 Reviewed-By: Mykola Bilochub <nbelochub@gmail.com> Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Based on #236.