Skip to content

Commit

Permalink
fix: fix postgresql golden tests (#866)
Browse files Browse the repository at this point in the history
Fix bug in PostgreSQL golden test parsing where the test case buffers
were not cleaned up after a test case finished.
  • Loading branch information
thiagotnunes authored Jul 10, 2024
1 parent 913f1bc commit 6871c00
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test_data/goldens/postgres/create_table.test
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
CREATE TABLE "table-with-invalid-chars$%^&" (
id bigint
);
ALTER TABLE "table-with-invalid-chars$%^&" ADD PRIMARY KEY (id)
--
CREATE TABLE `table_with_invalid_chars____` (
`id` INT64 NOT NULL ,
) PRIMARY KEY (`id`)
--
CREATE TABLE table_with_invalid_chars____ (
id INT8 NOT NULL ,
PRIMARY KEY (id)
)
==
CREATE TABLE test (
id bigint PRIMARY KEY,
col text
Expand Down
3 changes: 3 additions & 0 deletions testing/common/goldens.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ func GoldenTestCasesFrom(path string) ([]GoldenTestCase, error) {
ExpectedGSQLSchema: sanitizedGSQLSchema,
ExpectedPSQLSchema: sanitizedPSQLSchema})
parsingStatus = InputSchema
inputSchema.Reset()
expectedGSQLSchema.Reset()
expectedPSQLSchema.Reset()
continue
}

Expand Down

0 comments on commit 6871c00

Please sign in to comment.