diff --git a/IV/Makefile b/IV/Makefile index 43cd7b3..dfd5df5 100644 --- a/IV/Makefile +++ b/IV/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/IV/init.sql b/IV/init.sql index 4370f80..61e4c24 100644 --- a/IV/init.sql +++ b/IV/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/IV/tests-integration.sql b/IV/tests-rivers.sql similarity index 58% rename from IV/tests-integration.sql rename to IV/tests-rivers.sql index 28d3dd9..606e517 100644 --- a/IV/tests-integration.sql +++ b/IV/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;