Skip to content

Commit 9c908d6

Browse files
authored
Include the infinitearrays test helper only once (#356)
* Remove pirating infinite array `oneto` methods in tests * Include infinitearrays test helper only once
1 parent c8f88b9 commit 9c908d6

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

test/broadcasttests.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@ using LazyArrays, ArrayLayouts, LinearAlgebra, FillArrays, StaticArrays, Tracker
44
import LazyArrays: BroadcastLayout, arguments, LazyArrayStyle, sub_materialize
55
import Base: broadcasted
66

7-
include("infinitearrays.jl")
8-
using .InfiniteArrays
7+
using ..InfiniteArrays
98
using Infinities
109

1110
@testset "Broadcasting" begin
@@ -418,4 +417,4 @@ using Infinities
418417
end
419418
end
420419

421-
end #module
420+
end #module

test/cachetests.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import LazyArrays: CachedArray, CachedMatrix, CachedVector, PaddedLayout, Cached
66
CachedAbstractArray, CachedAbstractVector, CachedAbstractMatrix, AbstractCachedArray, AbstractCachedMatrix,
77
PaddedColumns
88

9-
include("infinitearrays.jl")
10-
using .InfiniteArrays
9+
using ..InfiniteArrays
1110
using .InfiniteArrays: OneToInf
1211
using Infinities
1312

test/paddedtests.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ import ArrayLayouts: OnesLayout
77
import Base: setindex
88
using LinearAlgebra
99

10-
include("infinitearrays.jl")
11-
using .InfiniteArrays: OneToInf
12-
1310
# padded block arrays have padded data that is also padded. This is to test this
1411
struct PaddedPadded <: LayoutVector{Int} end
1512

test/runtests.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ downstream_test = "--downstream_integration_test" in ARGS
1111
stale_deps=!downstream_test)
1212
end
1313

14+
# this should only be included once to avoid method overwritten warnings, as this commites type-piracy
15+
# we include this at the top-level, so that other sub-modules may reuse the module instead of having to include the file
16+
include("infinitearrays.jl")
17+
1418
@testset "Lazy MemoryLayout" begin
1519
@testset "ApplyArray" begin
1620
A = [1.0 2; 3 4]

0 commit comments

Comments
 (0)