Skip to content

Commit

Permalink
Reduce test data size, in order to speed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
murdos committed May 4, 2022
1 parent 299467c commit 796cafd
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 39,995 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
CREATE OR REPLACE FUNCTION generate_twkb_test_data(arr text[])
CREATE OR REPLACE FUNCTION generate_twkb_test_data(
arr text[],
xyprecisions int[] default ARRAY[-7, 0, 7],
zprecisions int[] default ARRAY[0, 7],
mprecisions int[] default ARRAY[0, 7]
)
RETURNS TABLE (input_wkt TEXT, xyprecision INT, zprecision INT, mprecision INT, withsize TEXT, withbbox TEXT, expected_wkt TEXT, expected_twkb TEXT)
AS $$
DECLARE
Expand Down Expand Up @@ -27,9 +32,9 @@ BEGIN

FOREACH inputwkt IN ARRAY arr
LOOP
FOR xy IN -7..7 LOOP
FOR z IN 0..7 LOOP
FOR m IN 0..7 LOOP
FOREACH xy IN ARRAY xyprecisions LOOP
FOREACH z IN ARRAY zprecisions LOOP
FOREACH m IN ARRAY mprecisions LOOP
--FOR withsize IN 0..1 LOOP
FOR withbbox IN 0..1 LOOP
expected_twkb = encode(ST_AsTWKB(inputwkt::geometry, xy, z, m, withsize::boolean, withbbox::boolean), 'hex');
Expand Down Expand Up @@ -101,7 +106,7 @@ COPY (SELECT * FROM generate_twkb_test_data(ARRAY[
'MULTIPOLYGON Z(((0 0 1,0 10 3,10 10 5,0 0 1),(1 1 9,1 2 9,2 2 9,2 1 9,1 1 9)),EMPTY,((1 1 9, -1 -1 7, 5 5 5, 1 1 3)))',
'MULTIPOLYGON M(((0 0 2,0 10 4,10 10 6,0 0 2),(1 1 9,1 2 9,2 2 9,2 1 9,1 1 9)),EMPTY,((1 1 8, -1 -1 6, 5 5 4, 1 1 2)))',
'MULTIPOLYGON ZM(((0 0 1 2,0 10 3 4,10 10 5 6,0 0 1 2),(1 1 9 9,1 2 9 9,2 2 9 9,2 1 9 9,1 1 9 9)),EMPTY,((1 1 9 8, -1 -1 7 6, 5 5 5 4, 1 1 3 2)))'
])
], ARRAY[-5, 1, 3], ARRAY[2, 4], ARRAY[3, 6])
ORDER BY input_wkt, xyprecision, zprecision, mprecision, withsize, withbbox
) TO '/tmp/multipolygons.csv' WITH (FORMAT CSV, HEADER, DELIMITER '|');

Expand Down
5,712 changes: 0 additions & 5,712 deletions modules/io/common/src/test/resources/testdata/twkb/geometrycollections.csv

Large diffs are not rendered by default.

5,712 changes: 0 additions & 5,712 deletions modules/io/common/src/test/resources/testdata/twkb/linestrings.csv

Large diffs are not rendered by default.

5,712 changes: 0 additions & 5,712 deletions modules/io/common/src/test/resources/testdata/twkb/multilinestrings.csv

Large diffs are not rendered by default.

5,712 changes: 0 additions & 5,712 deletions modules/io/common/src/test/resources/testdata/twkb/multipoints.csv

Large diffs are not rendered by default.

5,724 changes: 6 additions & 5,718 deletions modules/io/common/src/test/resources/testdata/twkb/multipolygons.csv

Large diffs are not rendered by default.

5,712 changes: 0 additions & 5,712 deletions modules/io/common/src/test/resources/testdata/twkb/points.csv

Large diffs are not rendered by default.

5,712 changes: 0 additions & 5,712 deletions modules/io/common/src/test/resources/testdata/twkb/polygons.csv

Large diffs are not rendered by default.

0 comments on commit 796cafd

Please sign in to comment.