Skip to content

Commit

Permalink
Test corner cases
Browse files Browse the repository at this point in the history
  • Loading branch information
joschmitt committed Sep 18, 2024
1 parent f005b15 commit 3239fe0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/flint/gfp_fmpz_poly-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,10 @@ end
fac = factor_equal_deg(f, 1)
@test length(fac) == 3
@test prod(fac) == f
f = x + 1
fac = factor_equal_deg(f, 1)
@test length(fac) == 1
@test prod(fac) == f

@test issetequal(roots(5 * x * (x^2 + 1)*(x^2 + 2)*(x+1)^2), F.([0, 123456789012345678948, 32539196700765078531, 90917592311580600418]))

Expand Down
4 changes: 4 additions & 0 deletions test/flint/gfp_poly-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,10 @@ end
fac = factor_equal_deg(f, 1)
@test length(fac) == 3
@test prod(fac) == f
f = x + 1
fac = factor_equal_deg(f, 1)
@test length(fac) == 1
@test prod(fac) == f

@test issetequal(roots(5 * x * (x^2 + 1)*(x^2 + 2)*(x+1)^10), R.([0, -1]))

Expand Down
7 changes: 7 additions & 0 deletions test/poly-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
# This is broken in AbstractAlgebra https://github.com/Nemocas/AbstractAlgebra.jl/pull/1799
#@test all(is_squarefree, keys(sf.fac))
@test evaluate(sf) == f

sf = factor_squarefree(Kx(1))
@test length(sf) == 0
@test evaluate(sf) == Kx(1)
sf = factor_squarefree(x)
@test length(sf) == 1
@test evaluate(sf) == x
end

@testset "Squarefreeness" begin
Expand Down

0 comments on commit 3239fe0

Please sign in to comment.