Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Remove direct dependency on github.com/sergi/go-diff #287

Merged
merged 2 commits into from Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -8,7 +8,6 @@ require (
github.com/hashicorp/go-version v1.4.0
github.com/hashicorp/hc-install v0.3.1
github.com/hashicorp/terraform-json v0.13.0
github.com/sergi/go-diff v1.2.0
github.com/zclconf/go-cty v1.10.0
github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b
)
Expand All @@ -26,6 +25,7 @@ require (
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect
Expand Down
20 changes: 7 additions & 13 deletions tfexec/internal/e2etest/show_test.go
Expand Up @@ -10,9 +10,9 @@ import (
"testing"

"github.com/andybalholm/crlf"
"github.com/google/go-cmp/cmp"
"github.com/hashicorp/go-version"
tfjson "github.com/hashicorp/terraform-json"
"github.com/sergi/go-diff/diffmatchpatch"

"github.com/hashicorp/terraform-exec/tfexec"
"github.com/hashicorp/terraform-exec/tfexec/internal/testutil"
Expand Down Expand Up @@ -609,10 +609,8 @@ func TestShowPlanFileRaw012_linux(t *testing.T) {
t.Fatal(err)
}

if strings.TrimSpace(actual) != strings.TrimSpace(string(expected)) {
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(strings.TrimSpace(actual), strings.TrimSpace(string(expected)), false)
t.Fatalf("actual:\n\n%s\n\nexpected:\n\n%s\n\ndiff:\n\n%s", actual, string(expected), dmp.DiffPrettyText(diffs))
if diff := cmp.Diff(strings.TrimSpace(actual), strings.TrimSpace(string(expected))); diff != "" {
t.Fatalf("unexpected difference: %s", diff)
}
})
}
Expand Down Expand Up @@ -640,10 +638,8 @@ func TestShowPlanFileRaw013(t *testing.T) {
t.Fatal(err)
}

if strings.TrimSpace(actual) != strings.TrimSpace(string(expected)) {
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(strings.TrimSpace(actual), strings.TrimSpace(string(expected)), false)
t.Fatalf("actual:\n\n%s\n\nexpected:\n\n%s\n\ndiff:\n\n%s", actual, string(expected), dmp.DiffPrettyText(diffs))
if diff := cmp.Diff(strings.TrimSpace(actual), strings.TrimSpace(string(expected))); diff != "" {
t.Fatalf("unexpected difference: %s", diff)
}
})
}
Expand All @@ -670,10 +666,8 @@ func TestShowPlanFileRaw014(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if strings.TrimSpace(actual) != strings.TrimSpace(string(expected)) {
dmp := diffmatchpatch.New()
diffs := dmp.DiffMain(strings.TrimSpace(actual), strings.TrimSpace(string(expected)), false)
t.Fatalf("actual:\n\n%s\n\nexpected:\n\n%s\n\ndiff:\n\n%s", actual, string(expected), dmp.DiffPrettyText(diffs))
if diff := cmp.Diff(strings.TrimSpace(actual), strings.TrimSpace(string(expected))); diff != "" {
t.Fatalf("unexpected difference: %s", diff)
}
})
}
Expand Down