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 more and generic test_elem methods #1822

Open
fingolfin opened this issue Oct 1, 2024 · 0 comments
Open

Add more and generic test_elem methods #1822

fingolfin opened this issue Oct 1, 2024 · 0 comments

Comments

@fingolfin
Copy link
Member

In order to run ring conformance tests, one has to provide a suitable test_elem method.

I think we should provide more generic ones for those, e.g. for polynomial and series ring. To this end we can make them recursive.

For example, we currently have

function test_elem(R::AbstractAlgebra.Rationals{BigInt})
   n = big(2)^rand(1:100)
   m = big(2)^rand(1:100)
   return rand(ZZ, -n:n)//rand(ZZ, 1:m)
end

which we could change to

function test_elem(R::AbstractAlgebra.Rationals)
   B = base_ring(R)
   return test_elem(B)//test_elem(B)
end

My motivation is that I wanted to add some conformance tests in Nemo so that the various mistakes I made in Nemocas/Nemo.jl#1869 (which @lgoettgens spotted) would be found by the new tests in #1816.

That requires me to write tests for a bunch of relative and absolute power series rings, and to me it seems this really are always the same...

(BTW I wonder if we should look into replacing our crude test_elem system with something more sophisticated like https://github.com/Seelengrab/Supposition.jl which implements "shrinking" to find minimal reproducers of issues which is really nice)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant