Skip to content

Commit

Permalink
Clarify and cleanup QuotientRing test (#509)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Schultz <tthsqe12@gmail.com>
  • Loading branch information
fingolfin and tthsqe12 committed Nov 9, 2021
1 parent a954a08 commit fa7a16f
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions test/ideal/sideal-test.jl
Original file line number Diff line number Diff line change
Expand Up @@ -427,13 +427,28 @@ end

@testset "sideal.GAlgebra" begin

R, (z, u, v, w) = @inferred PolynomialRing(QQ, ["z", "u", "v", "w"])
R, _ = @inferred PolynomialRing(QQ, ["z", "u", "v", "w"])

G, (z, u, v, w) = @inferred GAlgebra(R, Singular.Matrix(R, [0 -1 -1 -1; 0 0 -1 -1; 0 0 0 -1; 0 0 0 0]),
Singular.Matrix(R, [0 0 0 0; 0 0 0 0; 0 0 0 0; 0 0 0 0]))

@test_throws Exception QuotientRing(G, std(Ideal(R, [x])))
@test_throws Exception QuotientRing(G, Ideal(R, [x], twosided = true))
# error thrown if ideal is not a Gröbner basis (and not two sided)
I = Ideal(G, [u])
@test_throws ErrorException QuotientRing(G, I)

# error thrown if ideal is GB but not two sided
I = std(I)
@test_throws ErrorException QuotientRing(G, I)

# error thrown if ideal is two sided but not a GB
I = Ideal(G, [u], twosided = true)
@test_throws ErrorException QuotientRing(G, I)

# all good if two sided and GB
I = std(I)
@test QuotientRing(G, I)[1] isa PluralRing

# another test
I = @inferred Ideal(G, [z^2, u^2, v^2, w^2, z*u*v - w]; twosided = true)
Q, (z, u, v, w) = @inferred QuotientRing(G, std(I))
@test Q isa PluralRing
Expand Down

0 comments on commit fa7a16f

Please sign in to comment.