add test for #4247

This commit is contained in:
Matthew Hooker 2016-12-20 17:51:47 -08:00
parent 038787ed48
commit aa177de54b
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
package common
import (
"reflect"
"testing"
)
func TestStepTypeBootCommand_gather(t *testing.T) {
input := [][]string{
{"02", "82", "wait1", "03", "83"},
{"02", "82", "03", "83"},
{"wait5", "wait1", "wait10"},
{"wait5", "02", "82", "03", "83", "wait1", "wait10"},
}
expected := [][]string{
{"02 82", "wait1", "03 83"},
{"02 82 03 83"},
{"wait5", "wait1", "wait10"},
{"wait5", "02 82 03 83", "wait1", "wait10"},
}
for i, data := range input {
if !reflect.DeepEqual(gathercodes(data), expected[i]) {
t.Fatalf("%#v did not equal expected %#v", data, expected[i])
}
}
}