Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100755 30 lines (24 sloc) 0.435 kb
5f84926 @kr initial
kr authored
1 #!/bin/bash
2
3 set -e
4
5 : ${RUBY:=ruby}
6
7 cycle() {
8 $RUBY -r ./okjson -e 'print(OkJson.encode(OkJson.decode($stdin.read)))'
9 }
10
11 fs=$*
12 if test -z "$fs"
13 then fs=t/*.json
14 fi
15
16 for f in $fs
17 do
18 case $f in
19 t/valid*.json)
20 echo $f
21 cycle <$f >/dev/null
22 diff $f.exp <(cycle <$f 2>/dev/null)
23 ;;
24 t/invalid*.json)
25 echo $f
26 cycle <$f 2>/dev/null && { echo; exit 1; }
27 ;;
28 esac
29 done
Something went wrong with that request. Please try again.