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

Commit 596b858

Browse files
committed
fix most regression tests for new cube code.
1 parent 8aab197 commit 596b858

File tree

5 files changed

+49
-19
lines changed

5 files changed

+49
-19
lines changed

contrib/cube/expected/cube.out

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
-- first, define the datatype. Turn off echoing so that expected file
66
-- does not depend on contents of cube.sql.
77
--
8+
SET client_min_messages = warning;
89
\set ECHO none
9-
psql:cube.sql:10: NOTICE: type "cube" is not yet defined
10-
DETAIL: Creating a shell type definition.
11-
psql:cube.sql:14: NOTICE: return type cube is only a shell
12-
psql:cube.sql:18: NOTICE: return type cube is only a shell
13-
psql:cube.sql:23: NOTICE: argument type cube is only a shell
10+
RESET client_min_messages;
1411
--
1512
-- testing the input and output functions
1613
--

contrib/cube/expected/cube_1.out

+41-11
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
-- first, define the datatype. Turn off echoing so that expected file
66
-- does not depend on contents of cube.sql.
77
--
8+
SET client_min_messages = warning;
89
\set ECHO none
9-
psql:cube.sql:10: NOTICE: type "cube" is not yet defined
10-
DETAIL: Creating a shell type definition.
11-
psql:cube.sql:15: NOTICE: argument type cube is only a shell
10+
RESET client_min_messages;
1211
--
1312
-- testing the input and output functions
1413
--
@@ -395,6 +394,37 @@ SELECT '(0)'::text::cube;
395394
(0)
396395
(1 row)
397396

397+
--
398+
-- Test the float[] -> cube cast
399+
--
400+
SELECT cube('{0,1,2}'::float[], '{3,4,5}'::float[]);
401+
cube
402+
---------------------
403+
(0, 1, 2),(3, 4, 5)
404+
(1 row)
405+
406+
SELECT cube('{0,1,2}'::float[], '{3}'::float[]);
407+
ERROR: UR and LL arrays must be of same length
408+
SELECT cube(NULL::float[], '{3}'::float[]);
409+
cube
410+
------
411+
412+
(1 row)
413+
414+
SELECT cube('{0,1,2}'::float[]);
415+
cube
416+
-----------
417+
(0, 1, 2)
418+
(1 row)
419+
420+
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[3,2,1,1]);
421+
cube_subset
422+
---------------------------
423+
(5, 3, 1, 1),(8, 7, 6, 6)
424+
(1 row)
425+
426+
SELECT cube_subset(cube('(1,3,5),(6,7,8)'), ARRAY[4,0]);
427+
ERROR: Index out of bounds
398428
--
399429
-- Testing limit of CUBE_MAX_DIM dimensions check in cube_in.
400430
--
@@ -1021,24 +1051,24 @@ SELECT cube_enlarge('(2,-2),(-3,7)'::cube, -3, 2);
10211051
CREATE TABLE test_cube (c cube);
10221052
\copy test_cube from 'data/test_cube.data'
10231053
CREATE INDEX test_cube_ix ON test_cube USING gist (c);
1024-
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)';
1054+
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' ORDER BY c;
10251055
c
10261056
--------------------------
1027-
(2424, 160),(2424, 81)
1028-
(759, 187),(662, 163)
1029-
(1444, 403),(1346, 344)
1030-
(337, 455),(240, 359)
10311057
(1594, 1043),(1517, 971)
1058+
(337, 455),(240, 359)
1059+
(1444, 403),(1346, 344)
1060+
(759, 187),(662, 163)
1061+
(2424, 160),(2424, 81)
10321062
(5 rows)
10331063

10341064
-- Test sorting
1035-
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c;
1065+
SELECT * FROM test_cube WHERE c && '(3000,1000),(0,0)' GROUP BY c ORDER BY c;
10361066
c
10371067
--------------------------
1068+
(1594, 1043),(1517, 971)
10381069
(337, 455),(240, 359)
1039-
(759, 187),(662, 163)
10401070
(1444, 403),(1346, 344)
1041-
(1594, 1043),(1517, 971)
1071+
(759, 187),(662, 163)
10421072
(2424, 160),(2424, 81)
10431073
(5 rows)
10441074

contrib/cube/sql/cube.sql

+2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
-- first, define the datatype. Turn off echoing so that expected file
77
-- does not depend on contents of cube.sql.
88
--
9+
SET client_min_messages = warning;
910
\set ECHO none
1011
\i cube.sql
1112
\set ECHO all
13+
RESET client_min_messages;
1214

1315
--
1416
-- testing the input and output functions

contrib/earthdistance/expected/earthdistance.out

+2-3
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
-- first, define the datatype. Turn off echoing so that expected file
66
-- does not depend on contents of earthdistance.sql or cube.sql.
77
--
8+
SET client_min_messages = warning;
89
\set ECHO none
9-
psql:../cube/cube.sql:10: NOTICE: type "cube" is not yet defined
10-
DETAIL: Creating a shell type definition.
11-
psql:../cube/cube.sql:15: NOTICE: argument type cube is only a shell
10+
RESET client_min_messages;
1211
--
1312
-- The radius of the Earth we are using.
1413
--

contrib/earthdistance/sql/earthdistance.sql

+2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
-- first, define the datatype. Turn off echoing so that expected file
77
-- does not depend on contents of earthdistance.sql or cube.sql.
88
--
9+
SET client_min_messages = warning;
910
\set ECHO none
1011
\i ../cube/cube.sql
1112
\i earthdistance.sql
1213
\set ECHO all
14+
RESET client_min_messages;
1315

1416
--
1517
-- The radius of the Earth we are using.

0 commit comments

Comments
 (0)