diff --git a/Project.toml b/Project.toml index 4ceb8d5..e75a0b1 100644 --- a/Project.toml +++ b/Project.toml @@ -12,12 +12,16 @@ PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d" Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" [compat] +Aqua = "0.8" Base64 = "1" +CSV = "0.10" +DataFrames = "1" Dates = "1" HTTP = "0.8, 0.9, 1" JSON3 = "1" PrettyTables = "2" Tables = "1" +Test = "1" julia = "1.6" [extras] diff --git a/test/runtests.jl b/test/runtests.jl index dfc6d14..5e5024d 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,13 +6,14 @@ using DataFrames using Test using CSV -# Aqua.test_ambiguities([GBIF2, Base, Core]) -Aqua.test_unbound_args(GBIF2) -Aqua.test_stale_deps(GBIF2) -Aqua.test_undefined_exports(GBIF2) -Aqua.test_project_extras(GBIF2) -Aqua.test_deps_compat(GBIF2) -Aqua.test_project_toml_formatting(GBIF2) +@testset "Aqua.jl" begin + # Aqua.test_ambiguities([GBIF2, Base, Core]) + Aqua.test_unbound_args(GBIF2) + Aqua.test_stale_deps(GBIF2) + Aqua.test_undefined_exports(GBIF2) + Aqua.test_project_extras(GBIF2) + Aqua.test_deps_compat(GBIF2) +end sp = species_match("Lalage newtoni"; class="Aves", verbose=true) @@ -26,7 +27,7 @@ end sp1 = species(sp) @test sp1 isa GBIF2.Species @test sp1.species == "Coracina newtoni" - @test sp1.synonym == false + @test sp1.synonym isa Union{Bool,Missing} @test sp1.vernacularName == "Reunion Cuckooshrike" class = species(sp.classKey) @test ismissing(class.species) @@ -94,15 +95,17 @@ end CSV.write("occurence_test.csv", results) df = CSV.read("occurence_test.csv", DataFrame) foreach(enumerate(Tables.columns(df)), Tables.columns(DataFrame(results))) do (i, written), orig - if i == 72 + if i == 73 @test all(parse.(Int64, orig) .== written) - elseif i in [20, 45, 48, 49, 50, 51, 60, 61] + nothing + elseif i in [1, 19, 46, 49, 50, 51, 52, 61, 62] # skip # 20 => DateTime, 45-6: Vector{String} => String else - @test map(written, orig) do w, o + match = map(written, orig) do w, o ismissing(w) && ismissing(o) || w == o - end |> all + end |> all || @show i written orig + end end end