element/config/utils_test.go

23 lines
337 B
Go
Raw Permalink Normal View History

package config
import (
"testing"
)
var (
sampleConfig = `
ListenAddr = ":8080"
`
)
func TestParseConfig(t *testing.T) {
cfg, err := ParseConfig(sampleConfig)
if err != nil {
t.Fatalf("error parsing config: %s", err)
}
if cfg.ListenAddr != ":8080" {
t.Fatalf("expected listen addr :8080; received %s", cfg.ListenAddr)
}
}