diff options
author | Michael Paquier | 2022-03-15 01:52:19 +0000 |
---|---|---|
committer | Michael Paquier | 2022-03-15 01:52:19 +0000 |
commit | ff8b37ba801073b4506f670317141785bab9f4d8 (patch) | |
tree | 6b0063420d40c3a37dbc732196a7c9c34686c4ca /src/test/regress/expected/misc_functions.out | |
parent | c6f2f01611d4f2c412e92eb7893f76fa590818e8 (diff) |
Add more regression tests for pg_ls_dir()
This system function was being triggered once in the main regression
test suite to check its SRF configuration, and more in other test
modules but nothing checked the behavior of the options missing_ok and
include_dot_dirs. This commit adds some tests for both options, to
avoid mistakes if this code is manipulated in the future.
Extracted from a larger patch by the same author, with a few tweaks by
me.
Author: Justin Pryzby
Discussion: https://postgr.es/m/[email protected]
Diffstat (limited to 'src/test/regress/expected/misc_functions.out')
-rw-r--r-- | src/test/regress/expected/misc_functions.out | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/regress/expected/misc_functions.out b/src/test/regress/expected/misc_functions.out index 8567fcc2b45..01d1ad0b9a4 100644 --- a/src/test/regress/expected/misc_functions.out +++ b/src/test/regress/expected/misc_functions.out @@ -378,6 +378,29 @@ select * from (select pg_ls_dir('.') a) a where a = 'base' limit 1; base (1 row) +-- Test missing_ok (second argument) +select pg_ls_dir('does not exist', false, false); -- error +ERROR: could not open directory "does not exist": No such file or directory +select pg_ls_dir('does not exist', true, false); -- ok + pg_ls_dir +----------- +(0 rows) + +-- Test include_dot_dirs (third argument) +select count(*) = 1 as dot_found + from pg_ls_dir('.', false, true) as ls where ls = '.'; + dot_found +----------- + t +(1 row) + +select count(*) = 1 as dot_found + from pg_ls_dir('.', false, false) as ls where ls = '.'; + dot_found +----------- + f +(1 row) + select * from (select (pg_timezone_names()).name) ptn where name='UTC' limit 1; name ------ |