From c0532a0c7ba8d2c24928d6638b8759c2846c67f2 Mon Sep 17 00:00:00 2001 From: Nathanael Wong Date: Wed, 10 Jan 2024 10:15:10 -0100 Subject: [PATCH] Adding some more basic tests --- test/runtests.jl | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/test/runtests.jl b/test/runtests.jl index 2ca3a188..10e2ce42 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,7 +1,30 @@ using GeoRegions using Test -@testset "GeoRegions.jl" begin +@testset "Test that all predefined GeoRegions work" begin + + # Test all predefined GeoRegions + geov,_,_ = listGeoRegions() + for geo in geov + @test isGeoRegion(geo); + end + +end + +@testset "Test Creation, Detection and Removal of GeoRegions" begin + + @test isGeoRegion("TRP",throw=false) + geo = RectRegion("TRP","GLB","Tropics",[30,-30,0,360]) + geo = RectRegion("TRP_DTP","GLB","Tropics",[10,-10,0,360]) + @test isGeoRegion("TRP",throw=false) + removeGeoRegion("TRP") + @test isGeoRegion("TRP_DTP",throw=false) + removeGeoRegion("TRP_DTP") + @test isGeoRegion("TRP_DTP",throw=false) + +end + +@testset "Testing isPointinGeoRegion" begin # Test in operator A = Point2(-20,5) B = Point2(340,5)