Skip to content

Commit

Permalink
Added version check for keepat! tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jecs authored Feb 15, 2024
1 parent 76148b1 commit 7f6ea0e
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,10 @@ end
@test d == c == StructArray(a=[1,10,2,3], b=[2,20,3,4], c=["a","A","b","c"])
d = deleteat!(c, 2)
@test d == c == StructArray(a=[1,2,3], b=[2,3,4], c=["a","b","c"])
d = keepat!(c, 2)
@test d == c == StructArray(a=[2], b=[3], c=["b"])
if Base.VERSION >= v"1.7.0"
d = keepat!(c, 2)
@test d == c == StructArray(a=[2], b=[3], c=["b"])
end

c = StructArray(a=[1], b=[2], c=["a"])
d = [(a=10, b=20, c="A")]
Expand Down Expand Up @@ -297,8 +299,10 @@ end
@test d == c == StructArray{C}(a=[1,10,2,3], b=[2,20,3,4], c=["a","A","b","c"])
d = deleteat!(c, 2)
@test d == c == StructArray{C}(a=[1,2,3], b=[2,3,4], c=["a","b","c"])
d = keepat!(c, 2)
@test d == c == StructArray{C}(a=[2], b=[3], c=["b"])
if Base.VERSION >= v"1.7.0"
d = keepat!(c, 2)
@test d == c == StructArray{C}(a=[2], b=[3], c=["b"])
end

c = StructArray{C}(a=[1], b=[2], c=["a"])
d = [C(10, 20, "A")]
Expand Down

0 comments on commit 7f6ea0e

Please sign in to comment.