Skip to content

Commit

Permalink
Remove usage of log in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cespare committed Apr 26, 2016
1 parent 375d86f commit 91dc384
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
8 changes: 2 additions & 6 deletions decode_test.go
Expand Up @@ -9,10 +9,6 @@ import (
"time"
)

func init() {
log.SetFlags(0)
}

func TestDecodeSimple(t *testing.T) {
var testSimple = `
age = 250
Expand Down Expand Up @@ -454,7 +450,7 @@ name = "Rice"
`
m := &menu{}
if _, err := Decode(tomlBlob, m); err != nil {
log.Fatal(err)
t.Fatal(err)
}

if len(m.Dishes) != 2 {
Expand Down Expand Up @@ -490,7 +486,7 @@ name = "Rice"
// test on a value - must be passed as *
o := menu{}
if _, err := Decode(tomlBlob, &o); err != nil {
log.Fatal(err)
t.Fatal(err)
}

}
Expand Down
2 changes: 1 addition & 1 deletion encode_test.go
Expand Up @@ -36,7 +36,7 @@ func TestEncodeRoundTrip(t *testing.T) {
}
var outputs Config
if _, err := Decode(firstBuffer.String(), &outputs); err != nil {
log.Printf("Could not decode:\n-----\n%s\n-----\n",
t.Logf("Could not decode:\n-----\n%s\n-----\n",
firstBuffer.String())
t.Fatal(err)
}
Expand Down
3 changes: 1 addition & 2 deletions parse.go
Expand Up @@ -2,7 +2,6 @@ package toml

import (
"fmt"
"log"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -81,7 +80,7 @@ func (p *parser) next() item {
}

func (p *parser) bug(format string, v ...interface{}) {
log.Panicf("BUG: %s\n\n", fmt.Sprintf(format, v...))
panic(fmt.Sprintf("BUG: "+format+"\n\n", v...))
}

func (p *parser) expect(typ itemType) item {
Expand Down

0 comments on commit 91dc384

Please sign in to comment.