Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mjp98 committed Feb 3, 2023
1 parent b9f3e37 commit 75f5f2d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion test/_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ end

@test axiskeys(filter(isodd, V2),1) isa Vector{Int}
@test dimnames(filter(isodd, V2)) == (:v,)

V4 = wrapdims(rand(1:99, 10), collect(2:11))
V4c = copy(V4)
@test filter!(isodd, V4c) === V4c == filter(isodd, V4)
Expand Down Expand Up @@ -288,6 +288,17 @@ end
@test ka == KeyedArray([4, 5, 6.0], a=1:3)
end

@testset "empty!" begin
kv = wrapdims([1, 2, 3, 4, 5, 6.0], a=[:a, :b, :c, :d, :e, :f])
@test kv == empty!(kv)
@test isempty(kv)

# make sure array is not in an invalid state if the emtpy for indices fails
ka = wrapdims([4, 5, 6.0], a=1:3)
@test_throws MethodError empty!(ka)
@test ka == KeyedArray([4, 5, 6.0], a=1:3)
end

@testset "equality" begin

data = parent(parent(M))
Expand Down

0 comments on commit 75f5f2d

Please sign in to comment.