Move fixer test to fix package

Signed-off-by: Brendan Devenney <brendan.devenney@form3.tech>
This commit is contained in:
Brendan Devenney 2019-07-24 18:01:14 +01:00
parent 6520814a6c
commit 2b16b5cae4
No known key found for this signature in database
GPG Key ID: 71615073631A01E5
2 changed files with 29 additions and 25 deletions

View File

@ -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)
}
}
}

29
fix/fixer_test.go Normal file
View File

@ -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)
}
}
}