Add BurntSushi's test suite

This commit is contained in:
Thomas Pelletier
2013-12-10 14:43:27 +01:00
parent 2ba6587bf3
commit 40a44dc51f
3 changed files with 27 additions and 0 deletions
+1
View File
@@ -0,0 +1 @@
test_program/test_program_bin
+6
View File
@@ -0,0 +1,6 @@
#!/bin/bash
go get github.com/BurntSushi/toml-test # install test suite
go get github.com/BurntSushi/toml/toml-test-go # install my parser
go build -o test_program_bin github.com/pelletier/go-toml/test_program
$GOPATH/bin/toml-test ./test_program_bin # run tests on my parser
+20
View File
@@ -0,0 +1,20 @@
package main
import (
"io/ioutil"
"os"
"github.com/pelletier/go-toml"
)
func main() {
bytes, err := ioutil.ReadAll(os.Stdin)
if err != nil {
os.Exit(2)
}
_, err = toml.Load(string(bytes))
if err == nil {
os.Exit(0)
} else {
os.Exit(1)
}
}