Skip to content

Add string length tests for supplementary Unicode code points #52

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

Merged
merged 1 commit into from
Apr 13, 2014
Merged

Conversation

fge
Copy link
Contributor

@fge fge commented Apr 8, 2014

That is, code points outside the Basic Multilingual Plane (U+0000 to U+FFFF).

This will test that validators correctly account for the number of code points
inside strings, as required by RFC 7159, section 1:

A string is a sequence of zero or more Unicode characters [UNICODE].
Note that this citation references the latest version of Unicode
rather than a specific release. It is not expected that future
changes in the UNICODE specification will impact the syntax of JSON.

In order to keep it "easy" for storage, the UTF-16 escape sequence (as defined
by RFC 7159, section 7) is used to represent these characters. The chosen code
point is U+1F4A9 (yes, Unicode defines that):

http://www.fileformat.info/info/unicode/char/1F4A9/index.htm

@geraintluff
Copy link
Contributor

Looks great. :)

I'm seeing a Travis error saying the test descriptions are too long (should be < 60 chars), though. Would you be able to shorten them?

@fge
Copy link
Contributor Author

fge commented Apr 8, 2014

Uuuhuh.

Should mention that in the README before contributing... OK, at least the Travis report tells me how to run sanity checks.

But 60 chars? That's pretty short!

That is, code points outside the Basic Multilingual Plane (U+0000 to U+FFFF).

This will test that validators correctly account for the number of _code points_
inside strings, as required by RFC 7159, section 1:

   A string is a sequence of zero or more Unicode characters [UNICODE].
   Note that this citation references the latest version of Unicode
   rather than a specific release.  It is not expected that future
   changes in the UNICODE specification will impact the syntax of JSON.

In order to keep it "easy" for storage, the UTF-16 escape sequence (as defined
by RFC 7159, section 7) is used to represent these characters. The chosen code
point is U+1F4A9 (yes, Unicode defines that):

http://www.fileformat.info/info/unicode/char/1F4A9/index.htm
@fge
Copy link
Contributor Author

fge commented Apr 8, 2014

OK, fixed!

@Julian
Copy link
Member

Julian commented Apr 13, 2014

Yeah, the 60 char thing is mostly since some people (well, me, and I'm sure other people :D) use the descriptions to construct names of the test methods on xUnit test cases, so keeping those <80 means keeping the descriptions short.

Although I've wanted to add a full description field once in awhile for longer descriptions. Anyways, I'll fix and merge, thanks!

@Julian Julian merged commit bc84af3 into json-schema-org:develop Apr 13, 2014
@fge
Copy link
Contributor Author

fge commented Apr 13, 2014

Is it normal that travis didn't pick up the latest branch? Or it doesn't like push -f?

@Julian
Copy link
Member

Julian commented Apr 13, 2014

Hm. Did the force push have changes in it? The commit I see is bc84af3 which still looks like the first one. Sorry about that either way though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants