From 8331c718012d39b218efc524cdd01a20c007416e Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 9 Jan 2025 09:24:56 +0100 Subject: [PATCH] Add basic conformance tests for is_irreducible --- ext/TestExt/Rings-conformance-tests.jl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ext/TestExt/Rings-conformance-tests.jl b/ext/TestExt/Rings-conformance-tests.jl index 9f1140433..5b87e3d66 100644 --- a/ext/TestExt/Rings-conformance-tests.jl +++ b/ext/TestExt/Rings-conformance-tests.jl @@ -277,6 +277,12 @@ function ConformanceTests.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 @@ -474,6 +480,17 @@ function ConformanceTests.test_Poly_interface(Rx::AbstractAlgebra.PolyRing; reps @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 end return nothing