1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-07-30 14:10:31 +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:
kalmarek 2019-06-14 22:23:33 +02:00
commit d0fbd0301b

View File

@ -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)