git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4cb89d8)
chkpass: Add test suite
2017年8月12日 01:04:04 +0000 (21:04 -0400)
2017年9月15日 02:23:00 +0000 (22:23 -0400)
Reviewed-by: David Steele <david@pgmasters.net>
contrib/chkpass/.gitignore [new file with mode: 0644] patch | blob
contrib/chkpass/expected/chkpass.out [new file with mode: 0644] patch | blob
contrib/chkpass/sql/chkpass.sql [new file with mode: 0644] patch | blob

diff --git a/contrib/chkpass/.gitignore b/contrib/chkpass/.gitignore
new file mode 100644 (file)
index 0000000..5dcb3ff
--- /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 a2599ea239384ee6251579def2d38af1c65a28c0..dbecc3360be5f4f25f6ad965d1028c25dbcd57a8 100644 (file)
--- 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 (file)
index 0000000..b53557b
--- /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 (file)
index 0000000..595683e
--- /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;
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /