Skip to content

Commit dba8d9b

Browse files
committed
Add edge case tests
1 parent 07f3ede commit dba8d9b

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

test/basic_indexing.jl

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ testva = VectorOfArray(recs)
77

88
# broadcast with array
99
X = rand(3, 3)
10-
mulX = testva .* X
11-
ref = mapreduce((x,y)->x.*y, hcat, testva, eachcol(X))
10+
mulX = sqrt.(abs.(testva .* X))
11+
ref = mapreduce((x,y)->sqrt.(abs.(x.*y)), hcat, testva, eachcol(X))
1212
@test mulX == ref
1313
fill!(mulX, 0)
14-
mulX .= testva .* X
14+
mulX .= sqrt.(abs.(testva .* X))
1515
@test mulX == ref
1616

1717
t = [1,2,3]
@@ -107,3 +107,14 @@ x .= v .* v
107107
w = v .+ 1
108108
@test w isa VectorOfArray
109109
@test w.u == map(x -> x .+ 1, v.u)
110+
111+
# edges cases
112+
x = [1, 2, 3, 4, 5, 6, 7, 8, 9]
113+
testva = DiffEqArray(x, x)
114+
testvb = DiffEqArray(x, x)
115+
mulX = sqrt.(abs.(testva .* testvb))
116+
ref = sqrt.(abs.(x .* x))
117+
@test mulX == ref
118+
fill!(mulX, 0)
119+
mulX .= sqrt.(abs.(testva .* testvb))
120+
@test mulX == ref

0 commit comments

Comments
 (0)