diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..69cb7601 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1 @@ +comment: false diff --git a/src/fixed_arrays.jl b/src/fixed_arrays.jl index 6f25ebd5..afe07ceb 100644 --- a/src/fixed_arrays.jl +++ b/src/fixed_arrays.jl @@ -102,7 +102,7 @@ macro fixed_vector(name, parent) end Base.:(*)(a::$name, b::$name) = a .* b - + Base.broadcasted(f, a::AbstractArray{T}, b::$name) where T <: $name = Base.broadcasted(f, a, (b,)) end) end diff --git a/test/fixed_arrays.jl b/test/fixed_arrays.jl index 299f5a86..497ee829 100644 --- a/test/fixed_arrays.jl +++ b/test/fixed_arrays.jl @@ -6,9 +6,11 @@ using Test end @testset "broadcast" begin - x = [Point(2, 3), Point(7, 3)] + @testset for T in (Vec, Point) + x = [T(2, 3), T(7, 3)] - @test [Point(4, 9), Point(14, 9)] == x .* (Point(2, 3),) - @test [Point(4, 6), Point(9, 6)] == x .+ (Point(2, 3),) - @test [Point(0, 0), Point(5, 0)] == x .- (Point(2, 3),) + @test [T(4, 9), T(14, 9)] == x .* T(2, 3) + @test [T(4, 6), T(9, 6)] == x .+ T(2, 3) + @test [T(0, 0), T(5, 0)] == x .- T(2, 3) + end end