diff --git a/Makefile b/Makefile index a4d79a6..362c585 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ EXTRA_CLEAN = sql/$(EXTENSION)--$(EXTVERSION).sql $(EXTENSION).control TESTS = $(wildcard test/sql/*.sql) REGRESS = $(patsubst test/sql/%.sql,%,$(TESTS)) -REGRESS_OPTS = --use-existing --inputdir=test +REGRESS_OPTS = --inputdir=test MODULE_big = $(EXTENSION) SRC = $(wildcard $(SRC_DIR)/*.c) diff --git a/test/expected/00_init.out b/test/expected/00_init.out new file mode 100644 index 0000000..5d12a2f --- /dev/null +++ b/test/expected/00_init.out @@ -0,0 +1,25 @@ +CREATE TABLE projects +( id integer +, name text +, project_name text +, client_id integer +, subclient_id int +); +-- ensure these dropped column cases are tested +ALTER TABLE projects DROP COLUMN project_name; +ALTER TABLE projects DROP COLUMN subclient_id; +INSERT INTO projects VALUES (1, 'Windows 7', 1); +INSERT INTO projects VALUES (2, 'has,comma', 1); +INSERT INTO projects VALUES (NULL, NULL, NULL); +INSERT INTO projects VALUES (4, 'OSX', 2); +INSERT INTO projects VALUES (NULL, 'has"quote', NULL); +INSERT INTO projects VALUES (5, 'has,comma and "quote"', 7); +INSERT INTO projects VALUES (6, E'has \n LF', 7); +INSERT INTO projects VALUES (7, E'has \r CR', 8); +INSERT INTO projects VALUES (8, E'has \r\n CRLF"', 8); +create extension if not exists pg_csv; +CREATE TABLE nasty ( + "unusual"",names" INTEGER GENERATED ALWAYS AS IDENTITY, + text TEXT +); +INSERT INTO nasty (text) VALUES ('test'); diff --git a/test/init.sql b/test/sql/00_init.sql similarity index 100% rename from test/init.sql rename to test/sql/00_init.sql