Skip to content

Commit 8ea17bc

Browse files
Add ConformanceTests.generate_element for FracField (#2110)
1 parent 3abc3d0 commit 8ea17bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/generic/Fraction.jl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,3 +302,12 @@ function fraction_field(R::AbstractAlgebra.Ring; cached::Bool=true)
302302

303303
return FracField{T}(R, cached)
304304
end
305+
306+
function ConformanceTests.generate_element(R::FracField{T}) where {T <: RingElem}
307+
num = ConformanceTests.generate_element(base_ring(R))
308+
den = ConformanceTests.generate_element(base_ring(R))
309+
if iszero(den)
310+
den = one!(den)
311+
end
312+
return R(num, den)
313+
end

0 commit comments

Comments
 (0)