mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-11-27 07:21:09 +08:00
Split contrib/cube platform-depended checks into separate test
We're currently maintaining two outputs for cube regression test. But that appears to be unsuitable, because these outputs are different in out few checks involving scientific notation. So, split checks involving scientific notation into separate test, making contrib/cube easier to maintain. Backpatch to all supported versions in order to make further backpatching easier. Discussion: https://postgr.es/m/CAPpHfdvJgWjxHsJTtT%2Bo1tz3OR8EFHcLQjhp-d3%2BUcmJLh-fQA%40mail.gmail.com Author: Alexander Korotkov Backpatch-through: 9.3
This commit is contained in:
parent
db87d3b525
commit
5d6a1ee9a5
@ -6,7 +6,7 @@ OBJS= cube.o cubeparse.o
|
||||
EXTENSION = cube
|
||||
DATA = cube--1.0.sql cube--unpackaged--1.0.sql
|
||||
|
||||
REGRESS = cube
|
||||
REGRESS = cube cube_sci
|
||||
|
||||
EXTRA_CLEAN = y.tab.c y.tab.h
|
||||
|
||||
|
@ -54,108 +54,6 @@ SELECT '-1.0'::cube AS cube;
|
||||
(-1)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e+27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e+27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-7'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e-7'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
cube
|
||||
------------------------
|
||||
(1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
||||
SELECT '+1234567890123456'::cube AS cube;
|
||||
cube
|
||||
------------------------
|
||||
(1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1234567890123456'::cube AS cube;
|
||||
cube
|
||||
-------------------------
|
||||
(-1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
||||
SELECT '.1234567890123456'::cube AS cube;
|
||||
cube
|
||||
---------------------
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
106
contrib/cube/expected/cube_sci.out
Normal file
106
contrib/cube/expected/cube_sci.out
Normal file
@ -0,0 +1,106 @@
|
||||
---
|
||||
--- Testing cube output in scientific notation. This was put into separate
|
||||
--- test, because has platform-depending output.
|
||||
---
|
||||
SELECT '1e27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e+27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e+27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-7'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e-7'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
cube
|
||||
------------------------
|
||||
(1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
||||
SELECT '+1234567890123456'::cube AS cube;
|
||||
cube
|
||||
------------------------
|
||||
(1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1234567890123456'::cube AS cube;
|
||||
cube
|
||||
-------------------------
|
||||
(-1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
106
contrib/cube/expected/cube_sci_1.out
Normal file
106
contrib/cube/expected/cube_sci_1.out
Normal file
@ -0,0 +1,106 @@
|
||||
---
|
||||
--- Testing cube output in scientific notation. This was put into separate
|
||||
--- test, because has platform-depending output.
|
||||
---
|
||||
SELECT '1e27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e+27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e+27'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e+27)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-7'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e-7'::cube AS cube;
|
||||
cube
|
||||
---------
|
||||
(1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(-1e-07)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(-0)
|
||||
(1 row)
|
||||
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
cube
|
||||
------------------------
|
||||
(1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
||||
SELECT '+1234567890123456'::cube AS cube;
|
||||
cube
|
||||
------------------------
|
||||
(1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1234567890123456'::cube AS cube;
|
||||
cube
|
||||
-------------------------
|
||||
(-1.23456789012346e+15)
|
||||
(1 row)
|
||||
|
106
contrib/cube/expected/cube_sci_2.out
Normal file
106
contrib/cube/expected/cube_sci_2.out
Normal file
@ -0,0 +1,106 @@
|
||||
---
|
||||
--- Testing cube output in scientific notation. This was put into separate
|
||||
--- test, because has platform-depending output.
|
||||
---
|
||||
SELECT '1e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e+27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e+27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-7'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e-7'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
cube
|
||||
-------------------------
|
||||
(1.23456789012346e+015)
|
||||
(1 row)
|
||||
|
||||
SELECT '+1234567890123456'::cube AS cube;
|
||||
cube
|
||||
-------------------------
|
||||
(1.23456789012346e+015)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1234567890123456'::cube AS cube;
|
||||
cube
|
||||
--------------------------
|
||||
(-1.23456789012346e+015)
|
||||
(1 row)
|
||||
|
106
contrib/cube/expected/cube_sci_3.out
Normal file
106
contrib/cube/expected/cube_sci_3.out
Normal file
@ -0,0 +1,106 @@
|
||||
---
|
||||
--- Testing cube output in scientific notation. This was put into separate
|
||||
--- test, because has platform-depending output.
|
||||
---
|
||||
SELECT '1e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e+27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e+27'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e+27'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e+027)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-7'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '1.0e-7'::cube AS cube;
|
||||
cube
|
||||
----------
|
||||
(1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1.0e-7'::cube AS cube;
|
||||
cube
|
||||
-----------
|
||||
(-1e-007)
|
||||
(1 row)
|
||||
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(0)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
cube
|
||||
------
|
||||
(-0)
|
||||
(1 row)
|
||||
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
cube
|
||||
-------------------------
|
||||
(1.23456789012346e+015)
|
||||
(1 row)
|
||||
|
||||
SELECT '+1234567890123456'::cube AS cube;
|
||||
cube
|
||||
-------------------------
|
||||
(1.23456789012346e+015)
|
||||
(1 row)
|
||||
|
||||
SELECT '-1234567890123456'::cube AS cube;
|
||||
cube
|
||||
--------------------------
|
||||
(-1.23456789012346e+015)
|
||||
(1 row)
|
||||
|
@ -17,23 +17,6 @@ SELECT '.1'::cube AS cube;
|
||||
SELECT '-.1'::cube AS cube;
|
||||
SELECT '1.0'::cube AS cube;
|
||||
SELECT '-1.0'::cube AS cube;
|
||||
SELECT '1e27'::cube AS cube;
|
||||
SELECT '-1e27'::cube AS cube;
|
||||
SELECT '1.0e27'::cube AS cube;
|
||||
SELECT '-1.0e27'::cube AS cube;
|
||||
SELECT '1e+27'::cube AS cube;
|
||||
SELECT '-1e+27'::cube AS cube;
|
||||
SELECT '1.0e+27'::cube AS cube;
|
||||
SELECT '-1.0e+27'::cube AS cube;
|
||||
SELECT '1e-7'::cube AS cube;
|
||||
SELECT '-1e-7'::cube AS cube;
|
||||
SELECT '1.0e-7'::cube AS cube;
|
||||
SELECT '-1.0e-7'::cube AS cube;
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
SELECT '+1234567890123456'::cube AS cube;
|
||||
SELECT '-1234567890123456'::cube AS cube;
|
||||
SELECT '.1234567890123456'::cube AS cube;
|
||||
SELECT '+.1234567890123456'::cube AS cube;
|
||||
SELECT '-.1234567890123456'::cube AS cube;
|
||||
|
22
contrib/cube/sql/cube_sci.sql
Normal file
22
contrib/cube/sql/cube_sci.sql
Normal file
@ -0,0 +1,22 @@
|
||||
---
|
||||
--- Testing cube output in scientific notation. This was put into separate
|
||||
--- test, because has platform-depending output.
|
||||
---
|
||||
|
||||
SELECT '1e27'::cube AS cube;
|
||||
SELECT '-1e27'::cube AS cube;
|
||||
SELECT '1.0e27'::cube AS cube;
|
||||
SELECT '-1.0e27'::cube AS cube;
|
||||
SELECT '1e+27'::cube AS cube;
|
||||
SELECT '-1e+27'::cube AS cube;
|
||||
SELECT '1.0e+27'::cube AS cube;
|
||||
SELECT '-1.0e+27'::cube AS cube;
|
||||
SELECT '1e-7'::cube AS cube;
|
||||
SELECT '-1e-7'::cube AS cube;
|
||||
SELECT '1.0e-7'::cube AS cube;
|
||||
SELECT '-1.0e-7'::cube AS cube;
|
||||
SELECT '1e-700'::cube AS cube;
|
||||
SELECT '-1e-700'::cube AS cube;
|
||||
SELECT '1234567890123456'::cube AS cube;
|
||||
SELECT '+1234567890123456'::cube AS cube;
|
||||
SELECT '-1234567890123456'::cube AS cube;
|
Loading…
Reference in New Issue
Block a user