Skip to content

Commit f1e3052

Browse files
committed
Test array copying
1 parent 446fce6 commit f1e3052

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test/unittests.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,14 @@ end
577577
@inferred fv_square2(s_x)
578578
end
579579

580+
@testset "Copying" begin
581+
x = QuantityArray(randn(3), u"km/s")
582+
xc = copy(x)
583+
@test x == xc
584+
xc[2] *= 0.5
585+
@test x != xc
586+
end
587+
580588
@testset "Utilities" begin
581589
@test fill(u"m/s", 10) == QuantityArray(fill(1.0, 10) .* u"m/s")
582590
@test ndims(fill(u"m/s", ())) == 0

0 commit comments

Comments
 (0)