mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-09-05 14:46:44 +02:00
Merge branch 'enh/NCRing_interface' of https://git.wmi.amu.edu.pl/kalmar/GroupRings.jl into enh/NCRing_interface
This commit is contained in:
commit
d0fbd0301b
@ -3,6 +3,10 @@ using AbstractAlgebra
|
||||
|
||||
has_base_ring(R::AbstractAlgebra.NCRing) = base_ring(R) != Union{}
|
||||
|
||||
function AbstractAlgebra.promote_rule(::Type{S}, ::Type{T}) where {S <: Real, T <: Real}
|
||||
return Base.promote_rule(S, T)
|
||||
end
|
||||
|
||||
function test_data_type(f,g)
|
||||
@testset "Data type" begin
|
||||
f,g = deepcopy(f), deepcopy(g)
|
||||
@ -233,13 +237,11 @@ function test_promote_rules(f,g)
|
||||
@testset "Promote_type with $I" begin
|
||||
@test AbstractAlgebra.promote_rule(F, I) isa Type
|
||||
@test AbstractAlgebra.promote_rule(F, I) != Union{}
|
||||
@test AbstractAlgebra.promote_rule(F, I) ==
|
||||
AbstractAlgebra.promote_rule(I, F)
|
||||
end
|
||||
end
|
||||
|
||||
test_promotes(typeof(f), Int16)
|
||||
test_promotes(typeof(f), BigInt)
|
||||
test_promotes(typeof(f), Int)
|
||||
|
||||
test_promotes(typeof(f), typeof(g))
|
||||
@test AbstractAlgebra.promote_rule(typeof(f), typeof(g)) == typeof(f)
|
||||
|
Loading…
Reference in New Issue
Block a user