postgresql/src/test
Andres Freund ac00ff1c96 Add test of various escape functions
As highlighted by the prior commit, writing correct escape functions is less
trivial than one might hope.

This test module tries to verify that different escaping functions behave
reasonably. It e.g. tests:

- Invalidly encoded input to an escape function leads to invalidly encoded
  output

- Trailing incomplete multi-byte characters are handled sensibly

- Escaped strings are parsed as single statement by psql's parser (which
  derives from the backend parser)

There are further tests that would be good to add. But even in the current
state it was rather useful for writing the fix in the prior commit.

Reviewed-by: Noah Misch <noah@leadboat.com>
Backpatch-through: 13
Security: CVE-2025-1094
2025-02-10 10:03:37 -05:00
..
authentication require_auth: prepare for multiple SASL mechanisms 2025-01-31 15:47:28 +01:00
examples Update copyright for 2025 2025-01-01 11:21:55 -05:00
icu Update copyright for 2025 2025-01-01 11:21:55 -05:00
isolation Add OLD/NEW support to RETURNING in DML queries. 2025-01-16 14:57:35 +00:00
kerberos Update copyright for 2025 2025-01-01 11:21:55 -05:00
ldap Update copyright for 2025 2025-01-01 11:21:55 -05:00
locale Update copyright for 2025 2025-01-01 11:21:55 -05:00
mb
modules Add test of various escape functions 2025-02-10 10:03:37 -05:00
perl Refactor TAP test code for file comparisons into new routine in Utils.pm 2025-02-09 16:52:33 +09:00
postmaster Test postmaster with program_options_handling_ok() et al. 2025-01-26 09:39:05 -08:00
recovery Refactor TAP test code for file comparisons into new routine in Utils.pm 2025-02-09 16:52:33 +09:00
regress Add pg_encoding_set_invalid() 2025-02-10 10:03:37 -05:00
ssl Improve grammar of options for command arrays in TAP tests 2025-01-22 14:47:13 +09:00
subscription Virtual generated columns 2025-02-07 09:46:59 +01:00
Makefile Add PG_TEST_EXTRA configure option to the Make builds 2024-11-04 14:09:38 +02:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
README Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00

PostgreSQL tests
================

This directory contains a variety of test infrastructure as well as some of the
tests in PostgreSQL. Not all tests are here -- in particular, there are more in
individual contrib/ modules and in src/bin.

Not all these tests get run by "make check". Check src/test/Makefile to see
which tests get run automatically.

authentication/
  Tests for authentication (but see also below)

examples/
  Demonstration programs for libpq that double as regression tests via
  "make check"

isolation/
  Tests for concurrent behavior at the SQL level

kerberos/
  Tests for Kerberos/GSSAPI authentication and encryption

ldap/
  Tests for LDAP-based authentication

locale/
  Sanity checks for locale data, encodings, etc

mb/
  Tests for multibyte encoding (UTF-8) support

modules/
  Extensions used only or mainly for test purposes, generally not suitable
  for installing in production databases

perl/
  Infrastructure for Perl-based TAP tests

recovery/
  Test suite for recovery and replication

regress/
  PostgreSQL's main regression test suite, pg_regress

ssl/
  Tests to exercise and verify SSL certificate handling

subscription/
  Tests for logical replication