diff --git a/src/Modules/UngradedModules/FreeMod.jl b/src/Modules/UngradedModules/FreeMod.jl index de6b06f5a548..d092df9fcb30 100644 --- a/src/Modules/UngradedModules/FreeMod.jl +++ b/src/Modules/UngradedModules/FreeMod.jl @@ -318,7 +318,7 @@ function syzygy_generators( R = base_ring(F) m = length(g) G = (parent === nothing ? FreeMod(R, m) : parent)::typeof(F) - @assert ngens(G) == m "given parent does not have the correct number of generators" + @req ngens(G) != m "given parent does not have the correct number of generators" phi = hom(G, F, g) K, _ = kernel(phi) return ambient_representatives_generators(K) @@ -367,7 +367,7 @@ function syzygy_generators( I = ideal(R, a) s = Singular.syz(singular_generators(I)) F = (parent === nothing ? FreeMod(R, length(a)) : parent)::FreeMod{T} - @assert ngens(F) == length(a) "parent does not have the correct number of generators" + @req ngens(F) != length(a) "parent does not have the correct number of generators" @assert rank(s) == length(a) return elem_type(F)[F(s[i]) for i=1:Singular.ngens(s)] end diff --git a/test/Modules/UngradedModules.jl b/test/Modules/UngradedModules.jl index 24b29d6af0dd..5c4411fea1cf 100644 --- a/test/Modules/UngradedModules.jl +++ b/test/Modules/UngradedModules.jl @@ -1310,6 +1310,6 @@ end @test s1 == s2 s3 = syzygy_generators(ambient_representatives_generators(M)) @test s3 != s2 - @test_throws AssertionError syzygy_generators(ambient_representatives_generators(M); parent=F) + @test_throws ArgumentError syzygy_generators(ambient_representatives_generators(M); parent=F) end