Commit 8423bf4f authored by Peter Eisentraut's avatar Peter Eisentraut

chkpass: Add test suite

Reviewed-by: default avatarDavid Steele <david@pgmasters.net>
parent 4cb89d83
# Generated subdirectories
/log/
/results/
/tmp_check/
...@@ -9,6 +9,8 @@ PGFILEDESC = "chkpass - encrypted password data type" ...@@ -9,6 +9,8 @@ PGFILEDESC = "chkpass - encrypted password data type"
SHLIB_LINK = $(filter -lcrypt, $(LIBS)) SHLIB_LINK = $(filter -lcrypt, $(LIBS))
REGRESS = chkpass
ifdef USE_PGXS ifdef USE_PGXS
PG_CONFIG = pg_config PG_CONFIG = pg_config
PGXS := $(shell $(PG_CONFIG) --pgxs) PGXS := $(shell $(PG_CONFIG) --pgxs)
......
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)
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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment