Skip to content
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

Fix Test_issue80 on Go 1.8 #228

Merged
merged 1 commit into from
Feb 5, 2017
Merged

Fix Test_issue80 on Go 1.8 #228

merged 1 commit into from
Feb 5, 2017

Conversation

dsnet
Copy link
Contributor

@dsnet dsnet commented Nov 8, 2016

An upstream change (http://golang.org/cl/30371) makes the Go encoder
to be more compliant with the ES6 standard. Ironically, this change
causes Test_issue80 to fail on the larger number ranges.

To make this test work on both Go 1.7 and Go 1.8, we delete the larger
value tests, which are arguably locking in the wrong behavior.

Updates #80

An upstream change (http://golang.org/cl/30371) makes the Go encoder
to be more compliant with the ES6 standard. Ironically, this change
causes Test_issue80 to fail on the larger number ranges.

To make this test work on both Go 1.7 and Go 1.8, we delete the larger
value tests, which are arguably locking in the wrong behavior.
@dsnet
Copy link
Contributor Author

dsnet commented Nov 8, 2016

The JS engine in Chrome produces the following output for the given tests:

"[1401868959,14018689591,140186895901,1401868959001,14018689590001,140186895900001,1401868959000001,1401868959000001.5,14018689590000000,140186895900000000,1401868959000000000,14018689590000000000,140186895900000000000,140186895900000000000]"

This actually more closely matches to what Go 1.8 produces:

"[1401868959,14018689591,140186895901,1401868959001,14018689590001,140186895900001,1401868959000001,1401868959000001.5,14018689590000001,140186895900000001,1401868959000000001,14018689590000000000,140186895900000000000,140186895900000000000]"

And very different from the values locked in by the test (which is the Go 1.7 behavior).

"[1401868959,14018689591,140186895901,1401868959001,14018689590001,140186895900001,1401868959000001,1.4018689590000015e+15,14018689590000001,140186895900000001,1401868959000000001,1.401868959e+19,1.401868959e+20,1.401868959e+20]"

@dsnet
Copy link
Contributor Author

dsnet commented Nov 8, 2016

\cc @deoxxa

@stevenh
Copy link
Collaborator

stevenh commented Nov 9, 2016

Should the old test values be made pre 1.8 only?

@dsnet
Copy link
Contributor Author

dsnet commented Nov 9, 2016

I don't think so for the following reasons:

@stevenh stevenh merged commit 6a77b7c into robertkrimen:master Feb 5, 2017
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.

2 participants