From 79a31bd2fdc680d5fe9db40072d7f38826bfa29c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Wed, 19 May 2021 22:57:48 +0300 Subject: [PATCH] add some intersections --- Makefile | 10 +++++----- init.sql | 2 +- tests-integration.sql => tests-rivers.sql | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) rename tests-integration.sql => tests-rivers.sql (58%) diff --git a/Makefile b/Makefile index 43cd7b3..dfd5df5 100644 --- a/Makefile +++ b/Makefile @@ -41,8 +41,8 @@ mj-msc-full.pdf: mj-msc.pdf version.inc.tex $(ARCHIVABLES) ## Thesis for publish .PHONY: test test: .faux_test ## Unit tests (fast) -.PHONY: test-integration -test-integration: .faux_test-integration ## Integration tests (slow) +.PHONY: test-rivers +test-rivers: .faux_test-rivers ## Rivers tests (slow) .PHONY: slides slides: $(SLIDES) @@ -113,7 +113,7 @@ selfcrossing-1-after_2SELECT = wm_debug where name='selfcrossing-1' AND stage='b selfcrossing-1-after_2LINESTYLE = invisible -.faux_test-integration: tests-integration.sql wm.sql .faux_db +.faux_test-rivers: tests-rivers.sql wm.sql .faux_db ./db -f $< touch $@ @@ -161,7 +161,7 @@ mj-msc-gray.pdf: mj-msc.pdf .PHONY: clean clean: ## Clean the current working directory -./db stop - -rm -r .faux_test .faux_aggregate-rivers .faux_test-integration .faux_db \ + -rm -r .faux_test .faux_aggregate-rivers .faux_test-rivers .faux_db \ version.inc.tex vars.inc.tex version.aux version.fdb_latexmk \ _minted-mj-msc \ $(shell git ls-files -o mj-msc*) \ @@ -169,7 +169,7 @@ clean: ## Clean the current working directory $(SLIDES) .PHONY: clean-tables -clean-tables: ## Remove tables created during unit or integration tests +clean-tables: ## Remove tables created during unit or rivers tests ./db -c '\dt wm_*' | awk '/_/{print "drop table "$$3";"}' | ./db -f - -rm .faux_db diff --git a/init.sql b/init.sql index 4370f80..61e4c24 100644 --- a/init.sql +++ b/init.sql @@ -1,4 +1,4 @@ --- This file initializes tables for unit and integration tests. +-- This file initializes tables for unit and river tests. -- ST_SimplifyWM, when dbgname is non-empty, expects `wm_debug` table to be -- created. diff --git a/tests-integration.sql b/tests-rivers.sql similarity index 58% rename from tests-integration.sql rename to tests-rivers.sql index 28d3dd9..606e517 100644 --- a/tests-integration.sql +++ b/tests-rivers.sql @@ -1,5 +1,19 @@ \i wm.sql +insert into wm_visuals(name, way) values('salcia-visincia', + st_closestpoint( + (select way from wm_rivers where name='Šalčia'), + (select way from wm_rivers where name='Visinčia') + ) +); + +insert into wm_visuals(name, way) values('nemunas-merkys', + st_closestpoint( + (select way from wm_rivers where name='Nemunas'), + (select way from wm_rivers where name='Merkys') + ) +); + do $$ declare npoints bigint;