Move fixer test to fix package
Signed-off-by: Brendan Devenney <brendan.devenney@form3.tech>
This commit is contained in:
parent
6520814a6c
commit
2b16b5cae4
|
@ -1,7 +1,6 @@
|
||||||
package command
|
package command
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/hashicorp/packer/fix"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
@ -62,27 +61,3 @@ func TestFix_invalidTemplateDisableValidation(t *testing.T) {
|
||||||
fatalCommand(t, c.Meta)
|
fatalCommand(t, c.Meta)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestFix_allFixersEnabled(t *testing.T) {
|
|
||||||
f := fix.Fixers
|
|
||||||
o := fix.FixerOrder
|
|
||||||
|
|
||||||
if len(f) != len(o) {
|
|
||||||
t.Fatalf("Fixers length (%d) does not match FixerOrder length (%d)", len(f), len(o))
|
|
||||||
}
|
|
||||||
|
|
||||||
for fixer, _ := range f {
|
|
||||||
found := false
|
|
||||||
|
|
||||||
for _, orderedFixer := range o {
|
|
||||||
if orderedFixer == fixer {
|
|
||||||
found = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if !found {
|
|
||||||
t.Fatalf("Did not find Fixer %s in FixerOrder", fixer)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
package fix
|
||||||
|
|
||||||
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestFix_allFixersEnabled(t *testing.T) {
|
||||||
|
f := Fixers
|
||||||
|
o := FixerOrder
|
||||||
|
|
||||||
|
if len(f) != len(o) {
|
||||||
|
t.Fatalf("Fixers length (%d) does not match FixerOrder length (%d)", len(f), len(o))
|
||||||
|
}
|
||||||
|
|
||||||
|
for fixer, _ := range f {
|
||||||
|
found := false
|
||||||
|
|
||||||
|
for _, orderedFixer := range o {
|
||||||
|
if orderedFixer == fixer {
|
||||||
|
found = true
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if !found {
|
||||||
|
t.Fatalf("Did not find Fixer %s in FixerOrder", fixer)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue