diff --git a/test/tester_test.go b/test/tester_test.go index 348bb51c79783ecb6132be7a524beffbbaea54fe..1de5b8e69a8720944818cd800a7070a4d79e500d 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 0000000000000000000000000000000000000000..681e0033e7ec3f56c7a85ba7df4c07035a07239f --- /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"), + }, +}