v0.5 compliant
This commit is contained in:
parent
63793f92ef
commit
c32a6e92f1
|
@ -1,3 +1,5 @@
|
|||
*~
|
||||
|
||||
# Object files
|
||||
*.o
|
||||
*.ko
|
||||
|
|
18
README.md
18
README.md
|
@ -92,10 +92,18 @@ A normal *make* suffices. Alternately, you can also simply include the
|
|||
To test against the standard test set provided by BurntSushi/toml-test:
|
||||
|
||||
```
|
||||
% make
|
||||
% cd test
|
||||
% bash build.sh # do this once
|
||||
% bash run.sh # this will run the test suite
|
||||
```
|
||||
% make
|
||||
% cd test1
|
||||
% bash build.sh # do this once
|
||||
% bash run.sh # this will run the test suite
|
||||
```
|
||||
|
||||
|
||||
To test against the standard test set provided by iarna/toml:
|
||||
|
||||
```
|
||||
% make
|
||||
% cd test2
|
||||
% bash build.sh # do this once
|
||||
% bash run.sh # this will run the test suite
|
||||
```
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
mkdir -p $DIR/goworkspace
|
||||
export GOPATH=$DIR/goworkspace # if it isn't already set
|
||||
export GOPATH=$DIR/goworkspace
|
||||
go get github.com/BurntSushi/toml-test # install test suite
|
||||
go get github.com/BurntSushi/toml/cmd/toml-test-decoder # e.g., install my parser
|
||||
cp $GOPATH/bin/* .
|
|
@ -0,0 +1 @@
|
|||
/toml-spec-tests
|
|
@ -0,0 +1,6 @@
|
|||
set -e
|
||||
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
[ -d toml-spec-tests ] || git clone https://github.com/iarna/toml-spec-tests.git
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
#
|
||||
# POSITIVE tests
|
||||
#
|
||||
for i in toml-spec-tests/values/*.toml; do
|
||||
echo -n $i ' '
|
||||
../toml_json $i >& $i.json.out
|
||||
rc=$?
|
||||
[ -f $i.json ] && diff=$(diff $i.json $i.json.out) || diff=''
|
||||
if [ "$rc" != "0" ] || [ "$diff" != "" ]; then
|
||||
echo '[FAILED]'
|
||||
else
|
||||
echo '[OK]'
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
#
|
||||
# NEGATIVE tests
|
||||
#
|
||||
for i in toml-spec-tests/errors/*.toml; do
|
||||
echo -n $i ' '
|
||||
../toml_json $i >& $i.json.out
|
||||
rc=$?
|
||||
|
||||
if [ "$rc" != "0" ]; then
|
||||
echo '[OK]'
|
||||
else
|
||||
echo '[FAILED]'
|
||||
fi
|
||||
|
||||
done
|
Loading…
Reference in New Issue