Pgtap Versions Save

PostgreSQL Unit Testing Suite

v1.3.3

1 month ago

Changes for v1.3.3

  • Improved the correctness and performance of col_type_is on Postgres 17 thanks to the introduction of the to_regtypemod() function.
  • Fix bug introduced in v1.3.2 where col_type_is throws an error when the type isn't in the search path. Thanks to Erik Wienhold for the PR (#332)!
  • Removed the reference to PGUnit from the docs, as the project seems to have disappeared. Also the link to the GitHub repo. Thanks to Vick Khera for the report (#333)!

v1.3.2

3 months ago

Changes for v1.3.2

v1.3.1

7 months ago

Changes for v1.3.1:

  • Revamped the handling of data type declarations in col_type_is() to always accurately normalize data type representations, whether using aliases, such as varchar for character varying, or more complicated types that failed to work in v1.3.0, such as interval second(0). This is done by delegating the parsing of the type declaration to a core PostgresSQL function. Many thanks to Erik Wienhold for the report and for ultimately uncovering and implementing an SQL interface to the parseTypeString() core function (#315).
  • Removed the documentation for pg_typeof(), which was removed from pgTAP when support for PostgreSQL 8.3 was dropped, since the same function has been available in the PostgreSQL core since then.
  • Improved the support for type name aliases to the following functions:
    • has_cast()
    • hasnt_cast()
    • cast_context_is()
    • domain_type_is()
    • domain_type_isnt()
    • has_operator()
    • hasnt_operator()
  • Added the has_pk( :schema, :table ) variant, which requires that :table be cast to name to avoid confusion with the has_pk( :schema, :description ) variant. Thanks to Adrian Klaver for the report (#287)!

v1.3.0

9 months ago

Changes for v1.3.0:

  • Fixed an issue with xUnit tests where they would exit immediately on unexpected errors (aside from PL/pgSQL RAISE errors) rather than exit just the current test function. Thanks to @kzathey for the report and to @fjf2002 for the analysis.
  • Fixed a pluralization error reporting xUnit test failures to report "failed 1 test" instead of "failed 1 tests".
  • Removed the indentation for diagnostic comments at the start of subtests to make it easier to see where they start and end. This changes the output format, which will not affect tests run by pg_prove, but will break tests that depend on diffing files, as pg_regress does. Thanks to Matt DeLuco for highlighting the visual confusion of the indented diagnostic (#264).
  • Added variants of col_is_pk() with schema and without description (variants without schema or description already existed). Thanks to Luca Ferrari and Matteo Ferrando for the PRs (#178 & #199)!
  • Added a note on the use of temporary tables to the fk_ok() documentation, as well as a test to ensure the suggested expressions work. Thanks to Jim Nasby for highlighting the special treatment of the temporary schema (#109).
  • Removed redundant DROP statements from the 1.2.0 upgrade script that prevented upgrades from working properly. Thanks to @robins for the PR (#300)!
  • Fixed a test failure caused by the removal of support for select rules in postgres/postgres@b23cd18 (expected in Postgres 16). Thanks to @Deltaus for the report (#309)!
  • Fixed LIKE expression in schemas_are() to escape the underscore wildcard, making it pg\_% instead of pg_%. Thanks to Jehan-Guillaume (ioguix) de Rorthais for the PR (#311)!
  • Updated function-testing functions to allow short names for argument types, so that they can be specified as, e.g., int and bool rather than integer and boolean. The return value argument to function_returns and and data type tests such as col_type_is and cast_context_is must still use full type names. Thanks to @wphilips53 for the suggestion (#292).
  • Updated type-testing functions to allow short names for types, and updated function-testing functions to allow short names for argument types. This means that common aliases for standard types can be specified as, e.g., int and bool rather than integer and boolean. Thanks to @wphilips53 for the suggestion (#292).
  • Tweaked the installation docs for Docker, binary Linux distributions, and downloading the source from PGXN. Thanks to @jed-walker-icd (#275) and @machineghost (#301) for the suggestions!

v1.2.0

2 years ago

Changes for v1.2.0:

  • Made the description field optional in has_view() and hasnt_view() when specifying schema (#230). Thanks to Godwottery for the patch!
  • Added support for the date and time keywords CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, LOCALTIME, and LOCALTIMESTAMP to col_default_is(). Thanks to Kevin Brannen for the report (#244)!
  • Fixed failure to run tests on Postgres 13. Thanks to Christoph Berg for the report (#248).
  • Documented that mixed-case column names created with double quotes must be double-quoted when passed to has_index() or is_indexed(), sadly unlike other column arguments in pgTAP. Thanks to Keith Fiske for the report (#247).
  • Fixed test failures where the current username was not being quoted as an identifier. Thanks to Matt DeLuco for the report (#216) and pull request #259)!
  • Fixed the col_not_null() drop statements in the uninstall script. Thanks to Kyle L. Jensen for the report (#252).
  • Removed straggler references to Postgres 9.0 and earlier, including conditional tests.
  • Updated all relevant URLs to use https instead of http.
  • Added instructions to install the extension on a host with PostgreSQL running and with the contrib modules installed. Thanks to F. Eugene Aumson for the report (#276).
  • Fixed test failures due to changes in PostgreSQL 14. Thanks to Christoph Berg for the report (#277).
  • Added isnt_member_of() (#38, #204). Thanks to Wolfgang Walther for the pull request (#249).
  • Added docker files for local test environment. Thanks to Wolfgang Walther for the pull request (#250).
  • Added hasnt_operator(), hasnt_leftop(), hasnt_rightop() (#38). Thanks to Wolfgang Walther for the pull request (#251).
  • Improved the output of results_eq() and results_ne() when the number of columns or their types are different (#37). Thanks to Wolfgang Walther for the pull request (#255).
  • Fixed testing issue where tests for unsupported features were not properly skipped on Postgres 9.6 and earlier. Only appeared when tests were run serially (#279).
  • Fixed an issue where tests might not run in parallel even when the server supported it (#279).