diff --git a/.gitignore b/.gitignore index 15b499b..79f02e3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ .terraform plan.tfplan terraform.tfstate.backup + +# IntelliJ IDE files +.idea/ diff --git a/config_test.go b/config_test.go index c0cf1e0..a8bbf93 100644 --- a/config_test.go +++ b/config_test.go @@ -6,11 +6,12 @@ package tfjson import ( "encoding/json" "os" + "path/filepath" "testing" ) func TestConfigValidate(t *testing.T) { - f, err := os.Open("testdata/basic/plan.json") + f, err := os.Open(filepath.FromSlash("testdata/basic/plan.json")) if err != nil { t.Fatal(err) } diff --git a/metadata_test.go b/metadata_test.go index 9938a09..9b66b40 100644 --- a/metadata_test.go +++ b/metadata_test.go @@ -6,11 +6,12 @@ package tfjson import ( "encoding/json" "os" + "path/filepath" "testing" ) func TestMetadataFunctionsValidate(t *testing.T) { - f, err := os.Open("testdata/basic/functions.json") + f, err := os.Open(filepath.FromSlash("testdata/basic/functions.json")) if err != nil { t.Fatal(err) } diff --git a/plan_test.go b/plan_test.go index 2f9b37c..e757109 100644 --- a/plan_test.go +++ b/plan_test.go @@ -6,6 +6,7 @@ package tfjson import ( "encoding/json" "os" + "path/filepath" "reflect" "testing" @@ -13,7 +14,7 @@ import ( ) func TestPlanValidate(t *testing.T) { - f, err := os.Open("testdata/basic/plan.json") + f, err := os.Open(filepath.FromSlash("testdata/basic/plan.json")) if err != nil { t.Fatal(err) } @@ -30,7 +31,7 @@ func TestPlanValidate(t *testing.T) { } func TestPlan_015(t *testing.T) { - f, err := os.Open("testdata/basic/plan-0.15.json") + f, err := os.Open(filepath.FromSlash("testdata/basic/plan-0.15.json")) if err != nil { t.Fatal(err) } @@ -68,7 +69,7 @@ func TestPlan_015(t *testing.T) { } func TestPlan_withChecks(t *testing.T) { - f, err := os.Open("testdata/has_checks/plan.json") + f, err := os.Open(filepath.FromSlash("testdata/has_checks/plan.json")) if err != nil { t.Fatal(err) } @@ -101,7 +102,7 @@ func TestPlan_withChecks(t *testing.T) { } func TestPlan_movedBlock(t *testing.T) { - f, err := os.Open("testdata/moved_block/plan.json") + f, err := os.Open(filepath.FromSlash("testdata/moved_block/plan.json")) if err != nil { t.Fatal(err) } diff --git a/schemas_test.go b/schemas_test.go index 5044559..cf014a1 100644 --- a/schemas_test.go +++ b/schemas_test.go @@ -6,11 +6,12 @@ package tfjson import ( "encoding/json" "os" + "path/filepath" "testing" ) func TestProviderSchemasValidate(t *testing.T) { - f, err := os.Open("testdata/basic/schemas.json") + f, err := os.Open(filepath.FromSlash("testdata/basic/schemas.json")) if err != nil { t.Fatal(err) } @@ -27,7 +28,7 @@ func TestProviderSchemasValidate(t *testing.T) { } func TestProviderSchemasValidate_nestedAttributes(t *testing.T) { - f, err := os.Open("testdata/nested_attributes/schemas.json") + f, err := os.Open(filepath.FromSlash("testdata/nested_attributes/schemas.json")) if err != nil { t.Fatal(err) } diff --git a/state_test.go b/state_test.go index dee9021..c3bd4ee 100644 --- a/state_test.go +++ b/state_test.go @@ -7,11 +7,12 @@ import ( "encoding/json" "io/ioutil" "os" + "path/filepath" "testing" ) func TestStateValidate_raw(t *testing.T) { - f, err := os.Open("testdata/no_changes/state.json") + f, err := os.Open(filepath.FromSlash("testdata/no_changes/state.json")) if err != nil { t.Fatal(err) } @@ -28,7 +29,7 @@ func TestStateValidate_raw(t *testing.T) { } func TestStateUnmarshal_valid(t *testing.T) { - f, err := os.Open("testdata/no_changes/state.json") + f, err := os.Open(filepath.FromSlash("testdata/no_changes/state.json")) if err != nil { t.Fatal(err) } @@ -47,7 +48,7 @@ func TestStateUnmarshal_valid(t *testing.T) { } func TestStateUnmarshal_internalState(t *testing.T) { - f, err := os.Open("testdata/no_changes/terraform.tfstate") + f, err := os.Open(filepath.FromSlash("testdata/no_changes/terraform.tfstate")) if err != nil { t.Fatal(err) } @@ -71,7 +72,7 @@ func TestStateUnmarshal_internalState(t *testing.T) { } func TestStateValidate_fromPlan(t *testing.T) { - f, err := os.Open("testdata/no_changes/plan.json") + f, err := os.Open(filepath.FromSlash("testdata/no_changes/plan.json")) if err != nil { t.Fatal(err) } @@ -88,7 +89,7 @@ func TestStateValidate_fromPlan(t *testing.T) { } func TestStateValidate_fromPlan110(t *testing.T) { - f, err := os.Open("testdata/110_basic/plan.json") + f, err := os.Open(filepath.FromSlash("testdata/110_basic/plan.json")) if err != nil { t.Fatal(err) }