Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8423bf4

Browse files
committed
chkpass: Add test suite
Reviewed-by: David Steele <david@pgmasters.net>
1 parent 4cb89d8 commit 8423bf4

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

contrib/chkpass/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Generated subdirectories
2+
/log/
3+
/results/
4+
/tmp_check/

contrib/chkpass/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ PGFILEDESC = "chkpass - encrypted password data type"
99

1010
SHLIB_LINK = $(filter -lcrypt, $(LIBS))
1111

12+
REGRESS = chkpass
13+
1214
ifdef USE_PGXS
1315
PG_CONFIG = pg_config
1416
PGXS := $(shell $(PG_CONFIG) --pgxs)

contrib/chkpass/expected/chkpass.out

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
CREATE EXTENSION chkpass;
2+
WARNING: type input function chkpass_in should not be volatile
3+
CREATE TABLE test (i int, p chkpass);
4+
INSERT INTO test VALUES (1, 'hello'), (2, 'goodbye');
5+
SELECT i, p = 'hello' AS "hello?" FROM test;
6+
i | hello?
7+
---+--------
8+
1 | t
9+
2 | f
10+
(2 rows)
11+
12+
SELECT i, p <> 'hello' AS "!hello?" FROM test;
13+
i | !hello?
14+
---+---------
15+
1 | f
16+
2 | t
17+
(2 rows)
18+

contrib/chkpass/sql/chkpass.sql

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CREATE EXTENSION chkpass;
2+
3+
CREATE TABLE test (i int, p chkpass);
4+
INSERT INTO test VALUES (1, 'hello'), (2, 'goodbye');
5+
6+
SELECT i, p = 'hello' AS "hello?" FROM test;
7+
SELECT i, p <> 'hello' AS "!hello?" FROM test;

0 commit comments

Comments
 (0)