Skip to content

Commit 8fc81be

Browse files
authored
Fix tests (#448)
* Don't assume (io::IOBuffer).data is a Vector on new versions of Julia * Exclude test/subtype.jl from corpus due to new dependence on where precedence (#395)
1 parent a318134 commit 8fc81be

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/parse_stream.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,8 @@ function ParseStream(text::AbstractString, index::Integer=1; version=VERSION)
314314
end
315315

316316
# IO-based cases
317-
function ParseStream(io::IOBuffer; version=VERSION)
317+
# TODO: switch ParseStream to use a Memory internally on newer versions of Julia
318+
VERSION < v"1.11.0-DEV.753" && function ParseStream(io::IOBuffer; version=VERSION)
318319
ParseStream(io.data, io, position(io)+1, version)
319320
end
320321
function ParseStream(io::Base.GenericIOBuffer; version=VERSION)

test/parse_packages.jl

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ end
99
end
1010

1111
base_path = let
12-
p = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "base")
12+
p = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "base")
1313
if !isdir(p)
1414
# For julia 1.9 images.
15-
p = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "src", "base")
15+
p = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "src", "base")
1616
if !isdir(p)
1717
error("source for Julia base not found")
1818
end
@@ -39,10 +39,10 @@ base_tests_path = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test")
3939
return nothing
4040
end
4141

42-
if endswith(f, "core.jl")
42+
if endswith(f, "core.jl")
4343
# The test
4444
# @test Union{Tuple{T}, Tuple{T,Int}} where {T} === widen_diagonal(Union{Tuple{T}, Tuple{T,Int}} where {T})
45-
# depends on a JuliaSyntax bugfix and parses differently (wrong) using
45+
# depends on a JuliaSyntax bugfix and parses differently (wrong) using
4646
# flisp. This was added in julia#52228 and backported in julia#52045
4747
if v"1.10.0-rc1.39" <= VERSION
4848
return nothing
@@ -52,6 +52,11 @@ base_tests_path = joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "test")
5252
end
5353
end
5454

55+
# subtype.jl also depends on the where precedence JuliaSyntax bugfix as of julia#53034
56+
if endswith(f, "subtype.jl") && v"1.11.0-DEV.1382" <= VERSION
57+
return nothing
58+
end
59+
5560
return exprs_equal_no_linenum
5661
end
5762
end

0 commit comments

Comments
 (0)