|
43 | 43 | end
|
44 | 44 |
|
45 | 45 | @testset "2x2 StaticMatrix with 1x2 StaticMatrix" begin
|
| 46 | + # Issues #197, #242: broadcast between SArray and row-like SMatrix |
46 | 47 | m1 = @SMatrix [1 2; 3 4]
|
47 | 48 | m2 = @SMatrix [1 4]
|
48 |
| - @test_broken @inferred(broadcast(+, m1, m2)) === @SMatrix [2 6; 4 8] #197 |
49 |
| - @test_broken @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] |
50 | 51 | @test @inferred(m2 .+ m1) === @SMatrix [2 6; 4 8]
|
51 |
| - @test_broken @inferred(m1 .* m2) === @SMatrix [1 8; 3 16] #197 |
| 52 | + @test @inferred(m1 .* m2) === @SMatrix [1 8; 3 16] |
52 | 53 | @test @inferred(m2 .* m1) === @SMatrix [1 8; 3 16]
|
53 |
| - @test_broken @inferred(m1 ./ m2) === @SMatrix [1 1/2; 3 1] #197 |
| 54 | + @test @inferred(m1 ./ m2) === @SMatrix [1 1/2; 3 1] |
54 | 55 | @test @inferred(m2 ./ m1) === @SMatrix [1 2; 1/3 1]
|
55 |
| - @test_broken @inferred(m1 .- m2) === @SMatrix [0 -2; 2 0] #197 |
| 56 | + @test @inferred(m1 .- m2) === @SMatrix [0 -2; 2 0] |
56 | 57 | @test @inferred(m2 .- m1) === @SMatrix [0 2; -2 0]
|
57 |
| - @test_broken @inferred(m1 .^ m2) === @SMatrix [1 16; 1 256] #197 |
| 58 | + @test @inferred(m1 .^ m2) === @SMatrix [1 16; 3 256] |
58 | 59 | end
|
59 | 60 |
|
60 | 61 | @testset "1x2 StaticMatrix with StaticVector" begin
|
| 62 | + # Issues #197, #242: broadcast between SVector and row-like SMatrix |
61 | 63 | m = @SMatrix [1 2]
|
62 | 64 | v = SVector(1, 4)
|
63 | 65 | @test @inferred(broadcast(+, m, v)) === @SMatrix [2 3; 5 6]
|
64 | 66 | @test @inferred(m .+ v) === @SMatrix [2 3; 5 6]
|
65 |
| - @test_broken @inferred(v .+ m) === @SMatrix [2 3; 5 6] #197 |
| 67 | + @test @inferred(v .+ m) === @SMatrix [2 3; 5 6] |
66 | 68 | @test @inferred(m .* v) === @SMatrix [1 2; 4 8]
|
67 |
| - @test_broken @inferred(v .* m) === @SMatrix [1 2; 4 8] #197 |
| 69 | + @test @inferred(v .* m) === @SMatrix [1 2; 4 8] |
68 | 70 | @test @inferred(m ./ v) === @SMatrix [1 2; 1/4 1/2]
|
69 |
| - @test_broken @inferred(v ./ m) === @SMatrix [1 1/2; 4 2] #197 |
| 71 | + @test @inferred(v ./ m) === @SMatrix [1 1/2; 4 2] |
70 | 72 | @test @inferred(m .- v) === @SMatrix [0 1; -3 -2]
|
71 |
| - @test_broken @inferred(v .- m) === @SMatrix [0 -1; 3 2] #197 |
| 73 | + @test @inferred(v .- m) === @SMatrix [0 -1; 3 2] |
72 | 74 | @test @inferred(m .^ v) === @SMatrix [1 2; 1 16]
|
73 |
| - @test_broken @inferred(v .^ m) === @SMatrix [1 1; 4 16] #197 |
| 75 | + @test @inferred(v .^ m) === @SMatrix [1 1; 4 16] |
74 | 76 | end
|
75 | 77 |
|
76 | 78 | @testset "StaticVector with StaticVector" begin
|
|
87 | 89 | @test @inferred(v2 .- v1) === SVector(0, 2)
|
88 | 90 | @test @inferred(v1 .^ v2) === SVector(1, 16)
|
89 | 91 | @test @inferred(v2 .^ v1) === SVector(1, 16)
|
90 |
| - # test case issue #199 |
| 92 | + # Issue #199: broadcast with empty SArray |
91 | 93 | @test @inferred(SVector(1) .+ SVector()) === SVector()
|
92 |
| - @test_broken @inferred(SVector() .+ SVector(1)) === SVector() |
93 |
| - # test case issue #200 |
94 |
| - @test_broken @inferred(v1 .+ v2') === @SMatrix [2 5; 3 5] |
| 94 | + @test @inferred(SVector() .+ SVector(1)) === SVector() |
| 95 | + # Issue #200: broadcast with RowVector |
| 96 | + @test @inferred(v1 .+ v2') === @SMatrix [2 5; 3 6] |
95 | 97 | end
|
96 | 98 |
|
97 | 99 | @testset "StaticVector with Scalar" begin
|
|
0 commit comments