Giter Site home page Giter Site logo

snoe925 / jsontestsuite Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nst/jsontestsuite

0.0 2.0 0.0 83.25 MB

A comprehensive test suite for RFC 8259 compliant JSON parsers

License: MIT License

Swift 28.39% Shell 0.16% Objective-C 14.07% Lua 1.42% C 12.78% Python 0.98% Go 0.01% Rust 0.07% JavaScript 0.01% PHP 0.02% Perl 0.09% Ruby 0.06% R 0.01% CSS 0.04% HTML 0.91% Java 0.37% Haskell 0.02% C++ 40.58% QMake 0.01% Crystal 0.01%

jsontestsuite's Introduction

JSON Parsing Test Suite

A comprehensive test suite for RFC 8259 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 t-b avatar leonidas-from-xiv avatar mmastrac avatar stig avatar adamwill avatar am11 avatar plokhotnyuk avatar benibela avatar chreekat avatar 0xced avatar chulkilee avatar duelafn avatar dhobsd avatar rioderelfte avatar hlian avatar jamie-pate avatar jddurand avatar jgilje avatar juliusmusseau avatar daxim avatar michel-kraemer avatar swissquote-nst avatar rx14 avatar krono avatar tonyg avatar jhwoodyatt avatar obones avatar

Watchers

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.