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

DRIVERS-1859 BSON corpus code and symbol tests are partially testing the wrong types #1040

Open
japhb opened this issue Jul 15, 2021 · 2 comments

Comments

@japhb
Copy link

japhb commented Jul 15, 2021

In https://github.com/mongodb/specifications/blob/master/source/bson-corpus/tests/code.json starting with the fourth test (line 21 and following), the tests switch from correctly testing BSON type 0x0D (JavaScript code) to incorrectly testing BSON type 0x02 (regular strings).

Unfortunately, the comparison canonical_extjson seems to have been generated from the BSON, meaning that the tests succeed for the wrong reason -- they are regular string tests, not code tests.

Likewise, all of the decodeErrors tests are for regular strings, not code, despite the descriptions.

@japhb
Copy link
Author

japhb commented Jul 19, 2021

Turns out there's another test doing this, https://github.com/mongodb/specifications/blob/master/source/bson-corpus/tests/symbol.json -- all the decodeErrors tests are for regular strings (BSON type 0x02), not symbols (BSON type 0x0E), despite the descriptions.

@japhb japhb changed the title BSON corpus code test is partially testing the wrong type BSON corpus code and symbol tests are partially testing the wrong types Jul 19, 2021
@ShaneHarvey ShaneHarvey changed the title BSON corpus code and symbol tests are partially testing the wrong types DRIVERS-1859 BSON corpus code and symbol tests are partially testing the wrong types Jul 19, 2021
@ShaneHarvey
Copy link
Member

Thanks for reporting this @japhb, I've opened DRIVERS-1859 to help us track and fix this issue.

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

No branches or pull requests

2 participants