nst/JSONTestSuite

Add Postgres JSONB parser support

gsstark opened this issue · 0 comments

I think this is worth having since it's (yet another) json parser written from scratch. It mostly is unsurprising but has a couple quirks. a) Because Postgres is very picky about UTF8 encoding it refuses almost all the grey area cases having to do with encoding issues and b) Postgres cannot handle \u0000 due to internal code issues it fails those test cases.

I sent a pull request. It has a couple limitations: there are no crashes but if there were the tests would come up with weird results as the server crashing would cause all or many subsequent tests to fail. Also it just uses whatever server is running that it finds it can connect to -- by default that's anything running locally on the default port 5432. There's no attempt to check the server version which is a bit unfortunate. The server behaviour is unlikely to change any time soon though so that shouldn't cause any problems in practice.