Skip to content

Commit e220ad1

Browse files
authored
Remove testify (#1404)
1 parent 8c9c6ae commit e220ad1

File tree

2 files changed

+18
-19
lines changed

2 files changed

+18
-19
lines changed

formatter/sarif_test.go

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"testing"
88

99
hcl "github.com/hashicorp/hcl/v2"
10-
"github.com/stretchr/testify/assert"
1110
"github.com/terraform-linters/tflint/tflint"
1211
"github.com/xeipuuv/gojsonschema"
1312
)
@@ -266,22 +265,25 @@ func Test_sarifPrint(t *testing.T) {
266265
}
267266

268267
for _, tc := range cases {
269-
stdout := &bytes.Buffer{}
270-
stderr := &bytes.Buffer{}
271-
formatter := &Formatter{Stdout: stdout, Stderr: stderr, Format: "sarif"}
268+
t.Run(tc.Name, func(t *testing.T) {
269+
stdout := &bytes.Buffer{}
270+
stderr := &bytes.Buffer{}
271+
formatter := &Formatter{Stdout: stdout, Stderr: stderr, Format: "sarif"}
272272

273-
formatter.Print(tc.Issues, tc.Error, map[string][]byte{})
273+
formatter.Print(tc.Issues, tc.Error, map[string][]byte{})
274274

275-
if stdout.String() != tc.Stdout {
276-
t.Fatalf("Failed %s test: expected=%s, stdout=%s", tc.Name, tc.Stdout, stdout.String())
277-
}
275+
if stdout.String() != tc.Stdout {
276+
t.Fatalf("Failed %s test: expected=%s, stdout=%s", tc.Name, tc.Stdout, stdout.String())
277+
}
278278

279-
schemaLoader := gojsonschema.NewReferenceLoader("http://json.schemastore.org/sarif-2.1.0")
280-
result, err := gojsonschema.Validate(schemaLoader, gojsonschema.NewStringLoader(stdout.String()))
281-
282-
assert.NoError(t, err)
283-
for _, err := range result.Errors() {
284-
t.Error(err)
285-
}
279+
schemaLoader := gojsonschema.NewReferenceLoader("http://json.schemastore.org/sarif-2.1.0")
280+
result, err := gojsonschema.Validate(schemaLoader, gojsonschema.NewStringLoader(stdout.String()))
281+
if err != nil {
282+
t.Error(err)
283+
}
284+
for _, err := range result.Errors() {
285+
t.Error(err)
286+
}
287+
})
286288
}
287289
}

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ require (
3030
github.com/sourcegraph/go-lsp v0.0.0-20200429204803-219e11d77f5d
3131
github.com/sourcegraph/jsonrpc2 v0.1.0
3232
github.com/spf13/afero v1.8.2
33-
github.com/stretchr/testify v1.7.1
3433
github.com/terraform-linters/tflint-plugin-sdk v0.11.0
3534
github.com/xeipuuv/gojsonschema v1.2.0
3635
github.com/zclconf/go-cty v1.10.0
@@ -48,7 +47,6 @@ require (
4847
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
4948
github.com/aws/aws-sdk-go v1.42.43 // indirect
5049
github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
51-
github.com/davecgh/go-spew v1.1.1 // indirect
5250
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
5351
github.com/golang/protobuf v1.5.2 // indirect
5452
github.com/google/go-querystring v1.0.0 // indirect
@@ -66,8 +64,8 @@ require (
6664
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
6765
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
6866
github.com/oklog/run v1.0.0 // indirect
69-
github.com/pmezard/go-difflib v1.0.0 // indirect
7067
github.com/sergi/go-diff v1.2.0 // indirect
68+
github.com/stretchr/testify v1.7.1 // indirect
7169
github.com/ulikunitz/xz v0.5.8 // indirect
7270
github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect
7371
github.com/vmihailenco/tagparser v0.1.1 // indirect
@@ -85,5 +83,4 @@ require (
8583
google.golang.org/protobuf v1.28.0 // indirect
8684
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
8785
gopkg.in/yaml.v2 v2.4.0 // indirect
88-
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
8986
)

0 commit comments

Comments
 (0)