Mirror cleaner test code back from windows-shell to powershell

This commit is contained in:
DanHam 2017-01-19 13:33:59 +00:00
parent 2bd9fa6c70
commit 80ebcea5e1
No known key found for this signature in database
GPG Key ID: 58E79AEDD6AA987E
1 changed files with 14 additions and 28 deletions

View File

@ -310,37 +310,23 @@ func TestProvisionerQuote_EnvironmentVars(t *testing.T) {
"keyfive='value=five'",
"keysix='=six'",
}
expected := []string{
"keyone=valueone",
"keytwo=value\ntwo",
"keythree='valuethree'",
"keyfour='value\nfour'",
"keyfive='value=five'",
"keysix='=six'",
}
p := new(Provisioner)
p.Prepare(config)
expectedValue := "keyone=valueone"
if p.config.Vars[0] != expectedValue {
t.Fatalf("%s should be equal to %s", p.config.Vars[0], expectedValue)
}
expectedValue = "keytwo=value\ntwo"
if p.config.Vars[1] != expectedValue {
t.Fatalf("%s should be equal to %s", p.config.Vars[1], expectedValue)
}
expectedValue = "keythree='valuethree'"
if p.config.Vars[2] != expectedValue {
t.Fatalf("%s should be equal to %s", p.config.Vars[2], expectedValue)
}
expectedValue = "keyfour='value\nfour'"
if p.config.Vars[3] != expectedValue {
t.Fatalf("%s should be equal to %s", p.config.Vars[3], expectedValue)
}
expectedValue = "keyfive='value=five'"
if p.config.Vars[4] != expectedValue {
t.Fatalf("%s should be equal to %s", p.config.Vars[4], expectedValue)
}
expectedValue = "keysix='=six'"
if p.config.Vars[5] != expectedValue {
t.Fatalf("%s should be equal to %s", p.config.Vars[5], expectedValue)
for i, expectedValue := range expected {
if p.config.Vars[i] != expectedValue {
t.Fatalf("%s should be equal to %s", p.config.Vars[i], expectedValue)
}
}
}