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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 18 additions & 0 deletions
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

Lines changed: 7 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy