1
0
forked from MTSR/mapserver
mapserver/worldconfig/parse_test.go
Thomas Rudin bc223722af gofmt
2019-01-13 16:37:03 +01:00

37 lines
676 B
Go

package worldconfig
import (
"fmt"
"testing"
)
func TestParseSqlite(t *testing.T) {
cfg := Parse("./testdata/world.mt.sqlite")
if cfg.Backend != BACKEND_SQLITE3 {
t.Fatal("not sqlite3")
}
if cfg.PlayerBackend != BACKEND_FILES {
t.Fatal("not files")
}
}
func TestParsePostgres(t *testing.T) {
cfg := Parse("./testdata/world.mt.postgres")
fmt.Println(cfg)
if cfg.Backend != BACKEND_POSTGRES {
t.Fatal("not postgres")
}
if cfg.PlayerBackend != BACKEND_POSTGRES {
t.Fatal("not postgres")
}
if cfg.PsqlConnection.Host != "postgres" {
t.Fatal("param err")
}
if cfg.PsqlConnection.Port != 5432 {
t.Fatal("param err: ", cfg.PsqlConnection.Port)
}
}