Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 5f19412

Browse files
committed
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
1 parent b588cad commit 5f19412

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

src/test/regress/expected/boolean.out

+19
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,25 @@ SELECT isnul OR istrue OR isfalse FROM booltbl4;
566566
t
567567
(1 row)
568568

569+
-- Casts
570+
SELECT 0::boolean;
571+
bool
572+
------
573+
f
574+
(1 row)
575+
576+
SELECT 1::boolean;
577+
bool
578+
------
579+
t
580+
(1 row)
581+
582+
SELECT 2::boolean;
583+
bool
584+
------
585+
t
586+
(1 row)
587+
569588
--
570589
-- Clean up
571590
-- Many tables are retained by the regression test, but these do not seem

src/test/regress/sql/boolean.sql

+5
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ SELECT isfalse OR isnul OR istrue FROM booltbl4;
250250
SELECT istrue OR isfalse OR isnul FROM booltbl4;
251251
SELECT isnul OR istrue OR isfalse FROM booltbl4;
252252

253+
-- Casts
254+
SELECT 0::boolean;
255+
SELECT 1::boolean;
256+
SELECT 2::boolean;
257+
253258

254259
--
255260
-- Clean up

0 commit comments

Comments
 (0)