go-ethereum/statediff/config_test.go
2020-03-05 10:10:50 -06:00

25 lines
458 B
Go

package statediff_test
import (
"testing"
"github.com/ethereum/go-ethereum/statediff"
"github.com/ethereum/go-ethereum/statediff/testhelpers"
)
func TestNewMode(t *testing.T) {
mode, err := statediff.NewMode("csv")
if err != nil {
t.Errorf(testhelpers.ErrorFormatString, t.Name(), err)
}
if mode != statediff.CSV {
t.Error()
}
_, err = statediff.NewMode("not a real mode")
if err == nil {
t.Error("Expected an error, and got nil.")
}
}