Skip to content

Commit

Permalink
Skip a test on Go 1.13 where gofmt disagrees about formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminjkraft committed Aug 23, 2021
1 parent 0965329 commit a62553b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions generate/generate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"testing"

Expand Down Expand Up @@ -62,6 +63,13 @@ func TestGenerate(t *testing.T) {
t.Fatal(err)
}

if strings.HasPrefix(runtime.Version(), "go1.13") &&
sourceFilename == "InterfaceNesting.graphql" {
// gofmt on 1.13 formats this slightly differently.
// TODO(benkraft): Vendor in a specific version of gofmt,
// to use for all Go versions. (Maybe only for tests.)
}

for filename, content := range generated {
t.Run(filename, func(t *testing.T) {
testutil.Cupaloy.SnapshotT(t, string(content))
Expand Down

0 comments on commit a62553b

Please sign in to comment.