Skip to content

Commit fd1a84e

Browse files
committed
Add test
1 parent ed07b28 commit fd1a84e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/copy_static_array_test.jl

+20
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,23 @@ b = recursivecopy(a)
8282
@test a[1] == b[1]
8383
a[1] *= 2
8484
@test a[1] != b[1]
85+
86+
# Broadcasting when SVector{1}
87+
a = [SVector(0.0) for _ in 1:2]
88+
a_voa = VectorOfArray(a)
89+
b_voa = copy(a_voa)
90+
a_voa[1] = SVector(1.0)
91+
a_voa[2] = SVector(1.0)
92+
@. b_voa = a_voa
93+
@test b_voa[1] == a_voa[1]
94+
@test b_voa[2] == a_voa[2]
95+
96+
# Broadcasting when SVector{N} where N > 1
97+
a = [SVector(0.0, 0.0) for _ in 1:2]
98+
a_voa = VectorOfArray(a)
99+
b_voa = copy(a_voa)
100+
a_voa[1] = SVector(1.0, 1.0)
101+
a_voa[2] = SVector(1.0, 1.0)
102+
@. b_voa = a_voa
103+
@test b_voa[1] == a_voa[1]
104+
@test b_voa[2] == a_voa[2]

0 commit comments

Comments
 (0)