1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-24 10:47:04 +03:00

Add tests for int4_bool() in int.c

This cast was previously not covered at all by the regression tests.

Author: Christoph Berg
Discussion: https://postgr.es/m/ZYQZ1hNfLd_4rzkn@msg.df7cb.de
This commit is contained in:
Michael Paquier 2024-01-31 15:02:28 +09:00
parent b588cad688
commit 5f19412e4e
2 changed files with 24 additions and 0 deletions

View File

@ -566,6 +566,25 @@ SELECT isnul OR istrue OR isfalse FROM booltbl4;
t t
(1 row) (1 row)
-- Casts
SELECT 0::boolean;
bool
------
f
(1 row)
SELECT 1::boolean;
bool
------
t
(1 row)
SELECT 2::boolean;
bool
------
t
(1 row)
-- --
-- Clean up -- Clean up
-- Many tables are retained by the regression test, but these do not seem -- Many tables are retained by the regression test, but these do not seem

View File

@ -250,6 +250,11 @@ SELECT isfalse OR isnul OR istrue FROM booltbl4;
SELECT istrue OR isfalse OR isnul FROM booltbl4; SELECT istrue OR isfalse OR isnul FROM booltbl4;
SELECT isnul OR istrue OR isfalse FROM booltbl4; SELECT isnul OR istrue OR isfalse FROM booltbl4;
-- Casts
SELECT 0::boolean;
SELECT 1::boolean;
SELECT 2::boolean;
-- --
-- Clean up -- Clean up