Skip to content

Commit

Permalink
Merge pull request #213 from GenericMappingTools/add_tests
Browse files Browse the repository at this point in the history
A couple more tests
  • Loading branch information
joa-quim authored Apr 10, 2019
2 parents f468317 + f6af901 commit 1d1f3b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/psbasemap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,6 @@ end

# ---------------------------------------------------------------------------------------------------
basemap!(cmd0::String="", arg1=nothing; first=false, kw...) = basemap(cmd0, arg1; first=first, kw...)
basemap(arg1; first=true, kw...) = basemap("", arg1; first=first, kw...)
basemap!(arg1; first=false, kw...) = basemap("", arg1; first=first, kw...)

const psbasemap = basemap # Alias
const psbasemap! = basemap! # Alias
5 changes: 5 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ if (got_it) # Otherwise go straight to end
K = gmt2kml(D, F=:l, W=(1,:red));
gmtwrite("lixo.kml", K)
kml2gmt("lixo.kml", Z=true);
kml2gmt(nothing, "lixo.kml", Z=true); # yes, cheating
rm("lixo.kml")
end

Expand Down Expand Up @@ -242,6 +243,9 @@ if (got_it) # Otherwise go straight to end
I = gmtread("lixo.tif", img=true, band=[0 1 2]);
imshow(I, show=false) # Test this one here because we have a GMTimage at hand
gmtwrite("lixo.tif", mat2img(rand(UInt8,32,32,3)), driver=:GTiff)
@test GMT.parse_grd_format(Dict(:nan => 0)) == "+n0"
@test_throws ErrorException("Number of bands in the 'band' option can only be 1 or 3") GMT.gmtread("", band=[1 2])
@test_throws ErrorException("Format code MUST have 2 characters and not bla") GMT.parse_grd_format(Dict(:id => "bla"))
else
gmtwrite("lixo.grd", G)
GG = gmtread("lixo.grd", grd=true, varname=:z);
Expand Down Expand Up @@ -520,6 +524,7 @@ if (got_it) # Otherwise go straight to end
# PROJECT
if (GMTver >= 6)
project(C="15/15", T="85/40", G="1/110", L="-20/60"); # Fails in GMT5
project(nothing, C="15/15", T="85/40", G="1/110", L="-20/60"); # bit of cheating
end

# PSBASEMAP
Expand Down

0 comments on commit 1d1f3b8

Please sign in to comment.