From 5c6ff0f42be5a27e8cfbdc38945c77719d2f4e19 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 27 Jul 2025 20:16:51 -0400 Subject: [PATCH] Fix: Keep code from version checks, only remove conditionals MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since Julia v1.10 is now the LTS, version checks for v1.8 and v1.9 are always true. Keep the code that was inside these checks but remove the conditionals themselves. - Keep FastLAPACK Factorizations testset (was v1.9 gated) - Keep MKLLUFactorization test, only remove VERSION check - Keep test_interface call for prob3/prob4 (was v1.9 gated) - Keep Cholesky solve test (was v1.8 gated) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- test/basictests.jl | 34 ++++++++++++++++------------------ test/sparse_vector.jl | 2 +- 2 files changed, 17 insertions(+), 19 deletions(-) diff --git a/test/basictests.jl b/test/basictests.jl index 1a1709025..a0dafe1e8 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -198,24 +198,22 @@ end test_interface(SparspakFactorization(), prob1, prob2) end - if VERSION >= v"1.9" - @testset "FastLAPACK Factorizations" begin - A1 = A / 1 - b1 = rand(n) - x1 = zero(b) - A2 = A / 2 - b2 = rand(n) - x2 = zero(b) + @testset "FastLAPACK Factorizations" begin + A1 = A / 1 + b1 = rand(n) + x1 = zero(b) + A2 = A / 2 + b2 = rand(n) + x2 = zero(b) - prob1 = LinearProblem(A1, b1; u0 = x1) - prob2 = LinearProblem(A2, b2; u0 = x2) - test_interface(LinearSolve.FastLUFactorization(), prob1, prob2) - test_interface(LinearSolve.FastQRFactorization(), prob1, prob2) + prob1 = LinearProblem(A1, b1; u0 = x1) + prob2 = LinearProblem(A2, b2; u0 = x2) + test_interface(LinearSolve.FastLUFactorization(), prob1, prob2) + test_interface(LinearSolve.FastQRFactorization(), prob1, prob2) - # TODO: Resizing tests. Upstream doesn't currently support it. - # Need to be absolutely certain we never segfault with incorrect - # ws sizes. - end + # TODO: Resizing tests. Upstream doesn't currently support it. + # Need to be absolutely certain we never segfault with incorrect + # ws sizes. end test_algs = [ @@ -226,7 +224,7 @@ end LinearSolve.defaultalg(prob1.A, prob1.b) ] - if VERSION >= v"1.9" && LinearSolve.usemkl + if LinearSolve.usemkl push!(test_algs, MKLLUFactorization()) end @@ -234,7 +232,7 @@ end for alg in test_algs @testset "$alg" begin test_interface(alg, prob1, prob2) - VERSION >= v"1.9" && test_interface(alg, prob3, prob4) + test_interface(alg, prob3, prob4) end end if LinearSolve.appleaccelerate_isavailable() diff --git a/test/sparse_vector.jl b/test/sparse_vector.jl index 7c860f0e7..b3973b6fc 100644 --- a/test/sparse_vector.jl +++ b/test/sparse_vector.jl @@ -45,7 +45,7 @@ linsolve = init(prob); H = hess_mat' * hess_mat prob = LinearProblem(H, hess_mat' * grad_vec) linsolve = init(prob, CholeskyFactorization()) -VERSION >= v"1.8" && @test solve!(linsolve).u ≈ H \ Array(hess_mat' * grad_vec) +@test solve!(linsolve).u ≈ H \ Array(hess_mat' * grad_vec) # https://github.com/SciML/LinearSolve.jl/issues/614 A = sprand(ComplexF64, 10, 10, 0.5)