Skip to content

Commit b5dfa02

Browse files
committed
full code coverage
1 parent 200f88d commit b5dfa02

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/blockedtuple.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ end
3030
function Base.BroadcastStyle(::BlockedTupleBroadcastStyle, ::BlockedTupleBroadcastStyle)
3131
throw(DimensionMismatch("Incompatible blocks"))
3232
end
33-
Base.BroadcastStyle(::T, ::T) where {T<:BlockedTupleBroadcastStyle} = T
33+
# BroadcastStyle is not called for two identical styles
3434
function Base.copy(bc::Broadcast.Broadcasted{BlockedTupleBroadcastStyle{Divs}}) where {Divs}
3535
return BlockedTuple{Divs}(bc.f.((Tuple.(bc.args))...))
3636
end

test/test_blockedtuple.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ using TensorAlgebra: BlockedTuple, flatten_tuples
2424
@test bt[Block(2)] == blocks(bt)[2]
2525
@test bt[Block(1):Block(2)] == blocks(bt)[1:2]
2626
@test bt[Block(2)[1:2]] == ('a', 2)
27+
@test bt[2:4] == ('a', 2, 'b')
2728

2829
@test firstindex(bt) == 1
2930
@test lastindex(bt) == 5

0 commit comments

Comments
 (0)