0004-chkpass-Add-test-suite.patch

text/plain

Filename: 0004-chkpass-Add-test-suite.patch
Type: text/plain
Part: 3
Message: additional contrib test suites

Patch

Format: format-patch
Series: patch 0004
Subject: chkpass: Add test suite
File+
contrib/chkpass/expected/chkpass.out 18 0
contrib/chkpass/.gitignore 4 0
contrib/chkpass/Makefile 2 0
contrib/chkpass/sql/chkpass.sql 7 0
From 1d05800b4ecfc408ff3cb64fc95b78e24f044366 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Fri, 11 Aug 2017 21:04:04 -0400
Subject: [PATCH 4/7] chkpass: Add test suite

---
 contrib/chkpass/.gitignore           |  4 ++++
 contrib/chkpass/Makefile             |  2 ++
 contrib/chkpass/expected/chkpass.out | 18 ++++++++++++++++++
 contrib/chkpass/sql/chkpass.sql      |  7 +++++++
 4 files changed, 31 insertions(+)
 create mode 100644 contrib/chkpass/.gitignore
 create mode 100644 contrib/chkpass/expected/chkpass.out
 create mode 100644 contrib/chkpass/sql/chkpass.sql

diff --git a/contrib/chkpass/.gitignore b/contrib/chkpass/.gitignore
new file mode 100644
index 0000000000..5dcb3ff972
--- /dev/null
+++ b/contrib/chkpass/.gitignore
@@ -0,0 +1,4 @@
+# Generated subdirectories
+/log/
+/results/
+/tmp_check/
diff --git a/contrib/chkpass/Makefile b/contrib/chkpass/Makefile
index a2599ea239..dbecc3360b 100644
--- a/contrib/chkpass/Makefile
+++ b/contrib/chkpass/Makefile
@@ -9,6 +9,8 @@ PGFILEDESC = "chkpass - encrypted password data type"
 
 SHLIB_LINK = $(filter -lcrypt, $(LIBS))
 
+REGRESS = chkpass
+
 ifdef USE_PGXS
 PG_CONFIG = pg_config
 PGXS := $(shell $(PG_CONFIG) --pgxs)
diff --git a/contrib/chkpass/expected/chkpass.out b/contrib/chkpass/expected/chkpass.out
new file mode 100644
index 0000000000..b53557bf2a
--- /dev/null
+++ b/contrib/chkpass/expected/chkpass.out
@@ -0,0 +1,18 @@
+CREATE EXTENSION chkpass;
+WARNING:  type input function chkpass_in should not be volatile
+CREATE TABLE test (i int, p chkpass);
+INSERT INTO test VALUES (1, 'hello'), (2, 'goodbye');
+SELECT i, p = 'hello' AS "hello?" FROM test;
+ i | hello? 
+---+--------
+ 1 | t
+ 2 | f
+(2 rows)
+
+SELECT i, p <> 'hello' AS "!hello?" FROM test;
+ i | !hello? 
+---+---------
+ 1 | f
+ 2 | t
+(2 rows)
+
diff --git a/contrib/chkpass/sql/chkpass.sql b/contrib/chkpass/sql/chkpass.sql
new file mode 100644
index 0000000000..595683e249
--- /dev/null
+++ b/contrib/chkpass/sql/chkpass.sql
@@ -0,0 +1,7 @@
+CREATE EXTENSION chkpass;
+
+CREATE TABLE test (i int, p chkpass);
+INSERT INTO test VALUES (1, 'hello'), (2, 'goodbye');
+
+SELECT i, p = 'hello' AS "hello?" FROM test;
+SELECT i, p <> 'hello' AS "!hello?" FROM test;
-- 
2.14.0