AfieldTrails / s2-postgis

S2 Cell Id functions for PostgreSQL and PostGIS
MIT License
18 stars 5 forks source link

Assert s2_test #3

Open ppKrauss opened 5 years ago

ppKrauss commented 5 years ago

The assert validation is very commom in software package distributions... PostgreSQL have assert clause since v9.5, so a possible option is to change all s2_test.sql (example).

Other option, the easiest, is to add at git a s2_test.txt file with the s2_test.sql, that is,
psql _etc_ < s2_test.sql > s2_test.txt.
So, any one can assert by diff... or checking md5sum s2_test.txt, the my is 7d80522b55bd6e3270fb8ffde3a161cd.


My s2_test.txt:

 s2_cellid_from_latlng 
-----------------------
   1152921504606846977
(1 row)

 s2_cellid_from_latlng 
-----------------------
  -8689295774057980903
(1 row)

        s2_latlng_from_cellid         
--------------------------------------
 (40.4999999678024,-105.499999974886)
(1 row)

.....

 s2_token_edge_neighbors 
-------------------------
 87696d
 876969
 876941
 876915
(4 rows)

 s2_token_contains 
-------------------
 f
(1 row)

 s2_token_contains 
-------------------
 t
(1 row)

 s2_token_intersects 
---------------------
 t
(1 row)

 s2_token_intersects 
---------------------
 t
(1 row)
ppKrauss commented 5 years ago

Hum... only now I see because README.md say nothing:

So they are identical... (perhaps redundant).

... But is not same as my s2_test.txt: it is impossible to check because s2_test.out is a mixed file. ideal is to save at git only the output to be really checked by other users.