8000 test(endtoend): Enable for more build targets by kyleconroy · Pull Request #3041 · sqlc-dev/sqlc · GitHub
[go: up one dir, main page]

Skip to content

test(endtoend): Enable for more build targets #3041

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

Merged
merged 11 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Let's try again
  • Loading branch information
kyleconroy committed Dec 5, 2023
commit 0de46b7294225c07016da79687eab5f4a0a97ea9
12 changes: 10 additions & 2 deletions internal/endtoend/endtoend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,23 @@ func cmpDirectory(t *testing.T, dir string, actual map[string]string) {
t.Fatal(err)
}

if !cmp.Equal(expected, actual, cmpopts.EquateEmpty()) {
opts := []cmp.Option{
cmpopts.EquateEmpty(),
cmp.Transformer("LineEndings", func(in string) string {
// Replace Windows new lines with Unix newlines
return strings.Replace(in, "\r\n", "\n", -1)
}),
}

if !cmp.Equal(expected, actual, opts...) {
t.Errorf("%s contents differ", dir)
for name, contents := range expected {
name := name
if actual[name] == "" {
t.Errorf("%s is empty", name)
return
}
if diff := cmp.Diff(contents, actual[name]); diff != "" {
if diff := cmp.Diff(contents, actual[name], opts...); diff != "" {
t.Errorf("%s differed (-want +got):\n%s", name, diff)
}
}
Expand Down
0