2019-01-17 12:23:48 +03:00
|
|
|
package layerconfig
|
|
|
|
|
|
|
|
import (
|
2019-01-18 11:13:37 +03:00
|
|
|
"testing"
|
2019-01-17 12:23:48 +03:00
|
|
|
)
|
|
|
|
|
2019-01-18 11:13:37 +03:00
|
|
|
func TestReadJson(t *testing.T) {
|
|
|
|
layers, err := ParseFile("./testdata/layers.json")
|
2019-01-17 12:23:48 +03:00
|
|
|
|
2019-01-18 11:13:37 +03:00
|
|
|
if err != nil {
|
|
|
|
t.Fatal(err)
|
|
|
|
}
|
2019-01-17 12:23:48 +03:00
|
|
|
|
2019-01-18 11:13:37 +03:00
|
|
|
if layers == nil {
|
|
|
|
t.Fatal("no data")
|
|
|
|
}
|
2019-01-17 12:23:48 +03:00
|
|
|
|
2019-01-18 11:13:37 +03:00
|
|
|
if len(layers) != 1 {
|
|
|
|
t.Fatal("length mismatch")
|
|
|
|
}
|
2019-01-17 12:23:48 +03:00
|
|
|
|
2019-01-18 11:13:37 +03:00
|
|
|
if layers[0].Name != "Base" {
|
|
|
|
t.Fatal("name mismatch")
|
|
|
|
}
|
2019-01-17 12:23:48 +03:00
|
|
|
|
|
|
|
}
|