24 lines
460 B
Go
24 lines
460 B
Go
package vmware
|
|
|
|
import "testing"
|
|
|
|
func TestParseVMX(t *testing.T) {
|
|
contents := `
|
|
.encoding = "UTF-8"
|
|
config.version = "8"
|
|
`
|
|
|
|
results := ParseVMX(contents)
|
|
if len(results) != 2 {
|
|
t.Fatalf("not correct number of results: %d", len(results))
|
|
}
|
|
|
|
if results[".encoding"] != "UTF-8" {
|
|
t.Errorf("invalid .encoding: %s", results[".encoding"])
|
|
}
|
|
|
|
if results["config.version"] != "8" {
|
|
t.Errorf("invalid config.version: %s", results["config.version"])
|
|
}
|
|
}
|