Add BurntSushi's test suite
This commit is contained in:
@@ -0,0 +1 @@
|
||||
test_program/test_program_bin
|
||||
Executable
+6
@@ -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
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user