Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix two tests in preparation for julia nightly #3033

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions test/Rings/MPolyAnyMap/flattenings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,16 @@ end
R, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"], cached=false)
S, _ = polynomial_ring(R, ["s", "t"], cached=false)
phi = Oscar.flatten(S)
a = x^2 + y^2
b = phi(a)
@test phi(a) === b
a = 5
# julia might not consider `x^2+y^2` as being unused until the end of the scope
# see https://github.com/JuliaLang/julia/issues/51818
# so we put this into a function
function use_it(phi)
a = x^2 + y^2
b = phi(a)
@test phi(a) === b
a = nothing
end
use_it(phi)
GC.gc()
@test isempty(keys(Oscar.flat_counterparts(phi)))
end
Expand Down
6 changes: 4 additions & 2 deletions test/StraightLinePrograms/straightline.jl
Original file line number Diff line number Diff line change
Expand Up @@ -458,8 +458,10 @@ end
@test SLP.aslazyrec(p) == (x+2)*3.0-big(4)

@test_throws InexactError SLP.addeq!(p, SLProgram(Const(1.2)))
@assert length(p.cs) == 4 # p.cs was resized before append! failed
pop!(p.cs) # set back consistent state
# for julia 1.10 and older append! did resize before failing
# https://github.com/JuliaLang/julia/pull/51903
VERSION < v"1.11.0-DEV.884" && pop!(p.cs) # set back consistent state
@assert length(p.cs) == 3
@assert length(p.lines) == 3 # p.lines was *not* resized before append! failed
@test SLP.aslazyrec(p) == (x+2)*3.0-big(4)

Expand Down
Loading