Skip to content

Commit 9cf3d2a

Browse files
committed
Use more descriptive comments in test/broadcast.jl
1 parent 1fb2024 commit 9cf3d2a

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

test/broadcast.jl

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,34 +43,36 @@ end
4343
end
4444

4545
@testset "2x2 StaticMatrix with 1x2 StaticMatrix" begin
46+
# Issues #197, #242: broadcast between SArray and row-like SMatrix
4647
m1 = @SMatrix [1 2; 3 4]
4748
m2 = @SMatrix [1 4]
48-
@test @inferred(broadcast(+, m1, m2)) === @SMatrix [2 6; 4 8] #197
49-
@test @inferred(m1 .+ m2) === @SMatrix [2 6; 4 8] #197
49+
@test @inferred(broadcast(+, m1, m2)) === @SMatrix [2 6; 4 8]
50+
@test @inferred(m1 .+ m2) === @SMatrix [2 6; 4 8]
5051
@test @inferred(m2 .+ m1) === @SMatrix [2 6; 4 8]
51-
@test @inferred(m1 .* m2) === @SMatrix [1 8; 3 16] #197
52+
@test @inferred(m1 .* m2) === @SMatrix [1 8; 3 16]
5253
@test @inferred(m2 .* m1) === @SMatrix [1 8; 3 16]
53-
@test @inferred(m1 ./ m2) === @SMatrix [1 1/2; 3 1] #197
54+
@test @inferred(m1 ./ m2) === @SMatrix [1 1/2; 3 1]
5455
@test @inferred(m2 ./ m1) === @SMatrix [1 2; 1/3 1]
55-
@test @inferred(m1 .- m2) === @SMatrix [0 -2; 2 0] #197
56+
@test @inferred(m1 .- m2) === @SMatrix [0 -2; 2 0]
5657
@test @inferred(m2 .- m1) === @SMatrix [0 2; -2 0]
57-
@test @inferred(m1 .^ m2) === @SMatrix [1 16; 3 256] #197
58+
@test @inferred(m1 .^ m2) === @SMatrix [1 16; 3 256]
5859
end
5960

6061
@testset "1x2 StaticMatrix with StaticVector" begin
62+
# Issues #197, #242: broadcast between SVector and row-like SMatrix
6163
m = @SMatrix [1 2]
6264
v = SVector(1, 4)
6365
@test @inferred(broadcast(+, m, v)) === @SMatrix [2 3; 5 6]
6466
@test @inferred(m .+ v) === @SMatrix [2 3; 5 6]
65-
@test @inferred(v .+ m) === @SMatrix [2 3; 5 6] #197
67+
@test @inferred(v .+ m) === @SMatrix [2 3; 5 6]
6668
@test @inferred(m .* v) === @SMatrix [1 2; 4 8]
67-
@test @inferred(v .* m) === @SMatrix [1 2; 4 8] #197
69+
@test @inferred(v .* m) === @SMatrix [1 2; 4 8]
6870
@test @inferred(m ./ v) === @SMatrix [1 2; 1/4 1/2]
69-
@test @inferred(v ./ m) === @SMatrix [1 1/2; 4 2] #197
71+
@test @inferred(v ./ m) === @SMatrix [1 1/2; 4 2]
7072
@test @inferred(m .- v) === @SMatrix [0 1; -3 -2]
71-
@test @inferred(v .- m) === @SMatrix [0 -1; 3 2] #197
73+
@test @inferred(v .- m) === @SMatrix [0 -1; 3 2]
7274
@test @inferred(m .^ v) === @SMatrix [1 2; 1 16]
73-
@test @inferred(v .^ m) === @SMatrix [1 1; 4 16] #197
75+
@test @inferred(v .^ m) === @SMatrix [1 1; 4 16]
7476
end
7577

7678
@testset "StaticVector with StaticVector" begin
@@ -87,10 +89,10 @@ end
8789
@test @inferred(v2 .- v1) === SVector(0, 2)
8890
@test @inferred(v1 .^ v2) === SVector(1, 16)
8991
@test @inferred(v2 .^ v1) === SVector(1, 16)
90-
# test case issue #199
92+
# Issue #199: broadcast with empty SArray
9193
@test @inferred(SVector(1) .+ SVector()) === SVector()
9294
@test @inferred(SVector() .+ SVector(1)) === SVector()
93-
# test case issue #200
95+
# Issue #200: broadcast with RowVector
9496
@test @inferred(v1 .+ v2') === @SMatrix [2 5; 3 6]
9597
end
9698

0 commit comments

Comments
 (0)