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

Add basic conformance tests for is_irreducible #1952

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
17 changes: 17 additions & 0 deletions test/Rings-conformance-tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,12 @@ function test_Ring_interface(R::AbstractAlgebra.Ring; reps = 50)
@test B == b
end
end

@testset "Basic properties" begin
@test !is_irreducible(zero(R))
@test !is_irreducible(one(R))
end

end

return nothing
Expand Down Expand Up @@ -731,6 +737,17 @@ function test_Poly_interface(Rx::AbstractAlgebra.PolyRing; reps = 30)
@test is_monic(a) == isone(leading_coefficient(a))
end
end

@testset "Basic properties" begin
try
flag = is_irreducible(x)
@test flag || is_trivial(R)
catch e
if !(e isa NotImplementedError)
rethrow(e)
end
end
end
Comment on lines +741 to +750
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bit here is not yet done. The idea is to consider the test as passing if it throws a NotImplementedError. It's cumbersome this way (and not yet correct). Perhaps a @test_if_implemented macro could handle it nicer for use in other places. Or perhaps we investigate a completely different approach and e.g. add a trait can_compute(R, is_irreducible), that may be more reliable...

end

return nothing
Expand Down
Loading