Add tests for errors (fixes #5)

This commit is contained in:
Thomas Pelletier
2013-03-22 15:23:53 +01:00
parent 183bbe2aa9
commit 2bd1eb4f21
3 changed files with 18 additions and 3 deletions
+2 -1
View File
@@ -5,6 +5,7 @@
package toml
import (
"errors"
"runtime"
"strings"
)
@@ -81,7 +82,7 @@ func Load(content string) (tree *TomlTree, err error) {
if _, ok := r.(runtime.Error); ok {
panic(r)
}
err = r.(error)
err = errors.New(r.(string))
}
}()
_, flow := lex(content)