Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmu committed Dec 19, 2024
1 parent 1e4e807 commit a136495
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions testing/go/copy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestCopy(t *testing.T) {
},
Assertions: []ScriptTestAssertion{
{
Query: "COPY test_info FROM STDIN WITH (HEADER);",
Query: "COPY test_info FROM STDIN WITH (HEADER);",
CopyFromStdInFile: "tab-load-with-header.sql",
},
{
Expand All @@ -56,7 +56,7 @@ func TestCopy(t *testing.T) {
},
Assertions: []ScriptTestAssertion{
{
Query: "COPY regions (\"Id\", \"Code\", \"Capital\", \"Name\") FROM stdin;\n",
Query: "COPY regions (\"Id\", \"Code\", \"Capital\", \"Name\") FROM stdin;\n",
CopyFromStdInFile: "tab-load-with-quoted-column-names.sql",
},
},
Expand All @@ -68,7 +68,7 @@ func TestCopy(t *testing.T) {
},
Assertions: []ScriptTestAssertion{
{
Query: "COPY tbl1 FROM STDIN (FORMAT CSV)",
Query: "COPY tbl1 FROM STDIN (FORMAT CSV)",
CopyFromStdInFile: "csv-load-basic-cases.sql",
},
{
Expand All @@ -94,7 +94,7 @@ bar`, "baz"},
},
Assertions: []ScriptTestAssertion{
{
Query: " COPY tbl1 FROM STDIN (FORMAT CSV, HEADER TRUE);",
Query: " COPY tbl1 FROM STDIN (FORMAT CSV, HEADER TRUE);",
CopyFromStdInFile: "csv-load-with-header.sql",
},
{
Expand All @@ -114,7 +114,7 @@ bar`, "baz"},
},
Assertions: []ScriptTestAssertion{
{
Query: "COPY tbl1 FROM STDIN (FORMAT CSV);",
Query: "COPY tbl1 FROM STDIN (FORMAT CSV);",
CopyFromStdInFile: "csv-load-multi-chunk.sql",
},
{
Expand All @@ -134,7 +134,7 @@ bar`, "baz"},
},
Assertions: []ScriptTestAssertion{
{
Query: "COPY test_info FROM STDIN (FORMAT CSV, HEADER TRUE, DELIMITER '|');",
Query: "COPY test_info FROM STDIN (FORMAT CSV, HEADER TRUE, DELIMITER '|');",
CopyFromStdInFile: "psv-load.sql",
},
{
Expand All @@ -148,4 +148,4 @@ bar`, "baz"},
},
},
})
}
}
4 changes: 2 additions & 2 deletions testing/go/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type ScriptTestAssertion struct {

// Cols is used to check the column names returned from the server.
Cols []string

// CopyFromSTDIN is used to test the COPY FROM STDIN command.
CopyFromStdInFile string
}
Expand Down Expand Up @@ -235,7 +235,7 @@ func copyFromStdin(t *testing.T, conn *pgx.Conn, query string, filename string)
t.Fatalf("Failed to open file: %v", err)
}
defer file.Close()

reader := bufio.NewReader(file)
_, err = conn.PgConn().CopyFrom(context.Background(), reader, query)
require.NoError(t, err)
Expand Down

0 comments on commit a136495

Please sign in to comment.