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

Don't require base_ring in ring conformance tests #1946

Merged
merged 1 commit into from
Dec 23, 2024
Merged
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
11 changes: 7 additions & 4 deletions test/Rings-conformance-tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,13 @@ function test_NCRing_interface(R::AbstractAlgebra.NCRing; reps = 50)
@test is_domain_type(T) isa Bool
@test is_exact_type(T) isa Bool

@test base_ring_type(R) == typeof(base_ring(R))
@test base_ring_type(zero(R)) == typeof(base_ring(zero(R)))
@test base_ring_type(typeof(R)) == typeof(base_ring(R))
@test base_ring_type(T) == typeof(base_ring(zero(R)))
# if the ring supports base_ring, verify it also supports base_ring_type and is consistent
if applicable(base_ring, R)
@test base_ring_type(R) == typeof(base_ring(R))
@test base_ring_type(zero(R)) == typeof(base_ring(zero(R)))
@test base_ring_type(typeof(R)) == typeof(base_ring(R))
@test base_ring_type(T) == typeof(base_ring(zero(R)))
end

# some rings don't support characteristic and raise an exception (see issue #993)
try ch = characteristic(R)
Expand Down
Loading