Adding iodine error conversion

This commit is contained in:
Frederick F. Kautz IV
2015-04-08 19:32:37 -07:00
parent e2c54a0904
commit c12d5ea8a9
2 changed files with 35 additions and 0 deletions

View File

@@ -22,6 +22,7 @@ import (
"testing"
"encoding/json"
"os"
)
func TestIodine(t *testing.T) {
@@ -101,3 +102,15 @@ func TestState(t *testing.T) {
}
}
}
func TestToError(t *testing.T) {
_, err := os.Stat("hello")
ierr := New(err, nil)
if ToError(ierr) != err {
t.Error("Error is not the same")
}
ierr = New(ierr, nil)
if ToError(ierr) != err {
t.Error("Stacked Error is not the same")
}
}