Skip to content

Commit 03f28fd

Browse files
committed
Merge pull request #13585 from JuliaLang/anj/importall
A few missing imports in LinAlg and DataFmt
2 parents 6e4c9f1 + cd37f1b commit 03f28fd

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

base/datafmt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
module DataFmt
66

7-
import Base: _default_delims, tryparse_internal
7+
import Base: _default_delims, tryparse_internal, writemime
88

99
export countlines, readdlm, readcsv, writedlm, writecsv
1010

base/linalg.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import Base: A_mul_Bt, At_ldiv_Bt, A_rdiv_Bc, At_ldiv_B, Ac_mul_Bc, A_mul_Bc, Ac
77
Ac_ldiv_B, Ac_ldiv_Bc, At_mul_Bt, A_rdiv_Bt, At_mul_B
88
import Base: USE_BLAS64, abs, big, ceil, conj, convert, copy, copy!, copy_transpose!,
99
ctranspose, ctranspose!, eltype, eye, findmax, findmin, fill!, floor, full, getindex,
10-
imag, inv, isapprox, kron, ndims, power_by_squaring, print_matrix, real, setindex!,
11-
show, similar, size, transpose, transpose!, unsafe_getindex, unsafe_setindex!
10+
imag, inv, isapprox, kron, ndims, power_by_squaring, print_matrix, promote_rule, real,
11+
round, setindex!, show, similar, size, transpose, transpose!, trunc, unsafe_getindex,
12+
unsafe_setindex!
1213

1314
export
1415
# Modules

test/linalg/bidiag.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,13 @@ for relty in (Float32, Float64, BigFloat), elty in (relty, Complex{relty})
112112
debug && println("Round,float,trunc,ceil")
113113
if elty <: BlasReal
114114
@test floor(Int,T) == Bidiagonal(floor(Int,T.dv),floor(Int,T.ev),T.isupper)
115+
@test isa(floor(Int,T), Bidiagonal)
115116
@test trunc(Int,T) == Bidiagonal(trunc(Int,T.dv),trunc(Int,T.ev),T.isupper)
117+
@test isa(trunc(Int,T), Bidiagonal)
116118
@test round(Int,T) == Bidiagonal(round(Int,T.dv),round(Int,T.ev),T.isupper)
119+
@test isa(round(Int,T), Bidiagonal)
117120
@test ceil(Int,T) == Bidiagonal(ceil(Int,T.dv),ceil(Int,T.ev),T.isupper)
121+
@test isa(ceil(Int,T), Bidiagonal)
118122
end
119123

120124
debug && println("Generic Mat-vec ops")
@@ -184,5 +188,6 @@ end
184188
A = Bidiagonal(ones(Float32,10),ones(Float32,9),true)
185189
B = rand(Float64,10,10)
186190
C = Tridiagonal(rand(Float64,9),rand(Float64,10),rand(Float64,9))
191+
@test promote_rule(Matrix{Float64}, Bidiagonal{Float64}) == Matrix{Float64}
187192
@test promote(B,A) == (B,convert(Matrix{Float64},full(A)))
188193
@test promote(C,A) == (C,Tridiagonal(zeros(Float64,9),convert(Vector{Float64},A.dv),convert(Vector{Float64},A.ev)))

test/linalg/tridiag.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,13 @@ let n = 12 #Size of matrix problem to test
227227
debug && println("Rounding to Ints")
228228
if elty <: Real
229229
@test round(Int,A) == round(Int,fA)
230+
@test isa(round(Int,A), SymTridiagonal)
230231
@test trunc(Int,A) == trunc(Int,fA)
232+
@test isa(trunc(Int,A), SymTridiagonal)
231233
@test ceil(Int,A) == ceil(Int,fA)
234+
@test isa(ceil(Int,A), SymTridiagonal)
232235
@test floor(Int,A) == floor(Int,fA)
236+
@test isa(floor(Int,A), SymTridiagonal)
233237
end
234238

235239
debug && println("Tridiagonal/SymTridiagonal mixing ops")
@@ -341,9 +345,13 @@ let n = 12 #Size of matrix problem to test
341345
debug && println("Rounding to Ints")
342346
if elty <: Real
343347
@test round(Int,A) == round(Int,fA)
348+
@test isa(round(Int,A), Tridiagonal)
344349
@test trunc(Int,A) == trunc(Int,fA)
350+
@test isa(trunc(Int,A), Tridiagonal)
345351
@test ceil(Int,A) == ceil(Int,fA)
352+
@test isa(ceil(Int,A), Tridiagonal)
346353
@test floor(Int,A) == floor(Int,fA)
354+
@test isa(floor(Int,A), Tridiagonal)
347355
end
348356

349357
debug && println("Binary operations")

test/readdlm.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,3 +233,7 @@ end
233233
let data = "1 2 3"
234234
readdlm(IOBuffer(data), ' ', BigInt) == BigInt[1 2 3]
235235
end
236+
237+
# test writemime
238+
@test sprint(io -> writemime(io, "text/csv", [1 2; 3 4])) == "1,2\n3,4\n"
239+

0 commit comments

Comments
 (0)