Giter Club home page Giter Club logo

jsontestsuite's Introduction

JSON Parsing Test Suite

A comprehensive test suite for RFC 7159 compliant JSON parsers

This repository was created as an appendix to the article Parsing JSON is a Minefield ๐Ÿ’ฃ.

/parsers/

This directory contains several parsers and tiny wrappers to turn the parsers into JSON validators, by returning a specific value.

  • 0 the parser did accept the content
  • 1 the parser did reject the content
  • >1 the process did crash
  • timeout happens after 5 seconds

/test_parsing/

The name of these files tell if their contents should be accepted or rejected.

  • y_ content must be accepted by parsers
  • n_ content must be rejected by parsers
  • i_ parsers are free to accept or reject content

/test_transform/

These files contain weird structures and characters that parsers may understand differently, eg:

  • huge numbers
  • dictionaries with similar keys
  • NULL characters
  • escaped invalid strings

These files were used to produce results/transform.html.

/run_tests.py

Run all parsers with all files:

$ python3 run_tests.py

Run all parsers with a specific file:

$ python3 run_tests.py file.json

Run specific parsers with all files:

$ echo '["Python 2.7.10", "Python 3.5.2"]' > python_only.json
$ python3 run_tests.py --filter=python_only.json

The script writes logs in results/logs.txt.

The script then reads logs.txt and generates results/parsing.html.

/results/

JSON Parsing Tests

jsontestsuite's People

Contributors

nst avatar crisman avatar erickt avatar leonidas-from-xiv avatar mmastrac avatar chreekat avatar 0xced avatar duelafn avatar federicoceratto avatar rioderelfte avatar hlian avatar jamie-pate avatar jgilje avatar michel-kraemer avatar rx14 avatar stig avatar krono avatar tonyg avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.