summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Paquier2024-01-31 06:02:28 +0000
committerMichael Paquier2024-01-31 06:02:28 +0000
commit5f19412e4eae6468361f24fd20e05fb433da5538 (patch)
tree9e48bdf52e3a45d1e004a7653f66b741de207807 /src
parentb588cad688823b1e996ce05af4d88a954c005a3a (diff)
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/[email protected]
Diffstat (limited to 'src')
-rw-r--r--src/test/regress/expected/boolean.out19
-rw-r--r--src/test/regress/sql/boolean.sql5
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/regress/expected/boolean.out b/src/test/regress/expected/boolean.out
index 57d251eea76..0e99eb7ffc0 100644
--- a/src/test/regress/expected/boolean.out
+++ b/src/test/regress/expected/boolean.out
@@ -566,6 +566,25 @@ SELECT isnul OR istrue OR isfalse FROM booltbl4;
t
(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
-- Many tables are retained by the regression test, but these do not seem
diff --git a/src/test/regress/sql/boolean.sql b/src/test/regress/sql/boolean.sql
index 5b9dcd23172..85c6b019882 100644
--- a/src/test/regress/sql/boolean.sql
+++ b/src/test/regress/sql/boolean.sql
@@ -250,6 +250,11 @@ SELECT isfalse OR isnul OR istrue FROM booltbl4;
SELECT istrue OR isfalse OR isnul FROM booltbl4;
SELECT isnul OR istrue OR isfalse FROM booltbl4;
+-- Casts
+SELECT 0::boolean;
+SELECT 1::boolean;
+SELECT 2::boolean;
+
--
-- Clean up