From 7bf762555e37a8a6a0c88d57ac7cf30d14fee2ce Mon Sep 17 00:00:00 2001
From: Garet Halliday <me@garet.holiday>
Date: Wed, 13 Sep 2023 20:17:05 -0500
Subject: [PATCH] copy out tests

---
 test/tester_test.go    |  2 ++
 test/tests/copy_out.go | 35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 test/tests/copy_out.go

diff --git a/test/tester_test.go b/test/tester_test.go
index 348bb51c..1de5b8e6 100644
--- a/test/tester_test.go
+++ b/test/tester_test.go
@@ -47,6 +47,8 @@ func TestTester(t *testing.T) {
 		tests.EQP6,
 		tests.EQP7,
 		tests.EQP8,
+		tests.CopyOut0,
+		tests.CopyOut1,
 	); err != nil {
 		fmt.Print(err.Error())
 		t.Fail()
diff --git a/test/tests/copy_out.go b/test/tests/copy_out.go
new file mode 100644
index 00000000..681e0033
--- /dev/null
+++ b/test/tests/copy_out.go
@@ -0,0 +1,35 @@
+package tests
+
+import (
+	"pggat/test"
+	"pggat/test/inst"
+)
+
+var CopyOut0 = test.Test{
+	Name: "Copy Out 0",
+	Instructions: []inst.Instruction{
+		inst.SimpleQuery("CREATE TABLE test ( x integer NOT NULL, y varchar(40) NOT NULL PRIMARY KEY )"),
+		inst.SimpleQuery("INSERT INTO test VALUES (123, 'hello world')"),
+		inst.SimpleQuery("INSERT INTO test VALUES (-324, 'garet was here')"),
+		inst.SimpleQuery("COPY test TO STDOUT"),
+		inst.SimpleQuery("DROP TABLE test"),
+	},
+}
+
+var CopyOut1 = test.Test{
+	Name: "Copy Out 1",
+	Instructions: []inst.Instruction{
+		inst.SimpleQuery("CREATE TABLE test ( x integer NOT NULL, y varchar(40) NOT NULL PRIMARY KEY )"),
+		inst.SimpleQuery("INSERT INTO test VALUES (123, 'hello world')"),
+		inst.SimpleQuery("INSERT INTO test VALUES (-324, 'garet was here')"),
+		inst.Parse{
+			Query: "COPY test TO STDOUT",
+		},
+		inst.DescribePreparedStatement(""),
+		inst.Bind{},
+		inst.DescribePortal(""),
+		inst.Execute(""),
+		inst.Sync{},
+		inst.SimpleQuery("DROP TABLE test"),
+	},
+}
-- 
GitLab