Skip to content

Commit f784e51

Browse files
committed
Update doc on new behavior of functions_are()
And add doc for `procedures_are()`
1 parent 5b0daf5 commit f784e51

File tree

1 file changed

+42
-2
lines changed

1 file changed

+42
-2
lines changed

doc/pgtap.mmd

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,12 +2254,12 @@ missing triggers, like so:
22542254
: Name of a schema in which to find functions.
22552255

22562256
`:functions`
2257-
: An array of function and/or procedure names.
2257+
: An array of function names.
22582258

22592259
`:description`
22602260
: A short description of the test.
22612261

2262-
This function tests that all of the functions or procedures in the named schema,
2262+
This function tests that all of the functions in the named schema,
22632263
or that are visible in the search path, are only the functions that *should* be
22642264
there. If the `:schema` argument is omitted, functions will be sought in the
22652265
search path, excluding `pg_catalog` and `information_schema` If the description
@@ -2279,6 +2279,46 @@ missing functions, like so:
22792279
# Missing functions:
22802280
# frobnitz
22812281

2282+
### `procedures_are()` ###
2283+
2284+
SELECT ### `procedures_are()` ###
2285+
2286+
SELECT procedures_are( :schema, :procedures, :description );
2287+
SELECT procedures_are( :schema, :procedures );
2288+
SELECT procedures_are( :procedures, :description );
2289+
SELECT procedures_are( :procedures );
2290+
2291+
**Parameters**
2292+
2293+
`:schema`
2294+
: Name of a schema in which to find procedures.
2295+
2296+
`:procedures`
2297+
: An array of procedure names.
2298+
2299+
`:description`
2300+
: A short description of the test.
2301+
2302+
This function tests that all of the procedures in the named schema,
2303+
or that are visible in the search path, are only the procedures that *should* be
2304+
there. If the `:schema` argument is omitted, procedures will be sought in the
2305+
search path, excluding `pg_catalog` and `information_schema` If the description
2306+
is omitted, a generally useful default description will be generated. Example:
2307+
2308+
SELECT procedures_are(
2309+
'myschema',
2310+
ARRAY[ 'foo', 'bar', 'frobnitz' ]
2311+
);
2312+
2313+
In the event of a failure, you'll see diagnostics listing the extra and/or
2314+
missing procedures, like so:
2315+
2316+
# Failed test 150: "Schema someschema should have the correct procedures"
2317+
# Extra procedures:
2318+
# schnauzify
2319+
# Missing procedures:
2320+
# frobnitz
2321+
22822322
### `roles_are()` ###
22832323

22842324
SELECT roles_are( :roles, :description );

0 commit comments

Comments
 (0)