File tree Expand file tree Collapse file tree 2 files changed +37
-0
lines changed
Expand file tree Collapse file tree 2 files changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ import osproc, os, strutils, sequtils
2+
3+ # https://github.com/nst/JSONTestSuite
4+ # A comprehensive test suite for RFC 8259 compliant JSON parsers
5+
6+ let p = absolutePath (" ../JSONTestSuite/test_parsing/*" )
7+
8+ for f in toSeq (os.walkFiles (p)):
9+ let
10+ what = f.split (" /" )[^ 1 ][0 ]
11+ cmd = " tests/run_test_jsony" & " " & f
12+ code = execCmd (cmd)
13+ var status =
14+ if code == 2 :
15+ if what == 'y' : " good "
16+ elif what == 'n' : " fail "
17+ elif what == 'i' : " good "
18+ else : " ?"
19+ elif code == 1 :
20+ if what == 'y' : " fail "
21+ elif what == 'n' : " good "
22+ elif what == 'i' : " good "
23+ else : " ?"
24+ else : " crash"
25+ echo " [" , status, " ] " , cmd
Original file line number Diff line number Diff line change 1+ # Rebuild with: nim c -d:release
2+
3+ import json
4+ import os
5+
6+ let fn = os.paramStr (1 )
7+
8+ try :
9+ discard fn.readFile ().parseJson ()
10+ quit (2 )
11+ except :
12+ quit (1 )
You can’t perform that action at this time.
0 commit comments