mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-12-29 11:00:28 +01:00
update tests for promote_rules
This commit is contained in:
parent
9e5a307ee3
commit
cc7eb9b699
@ -229,16 +229,25 @@ function test_promote_rules(f,g)
|
||||
f,g = deepcopy(f), deepcopy(g)
|
||||
@testset "promote_rules" begin
|
||||
|
||||
@test_broken AbstractAlgebra.promote_rule(typeof(f), Int16) == typeof(f)
|
||||
@test_broken promote_rule(typeof(f), BigInt) == typeof(f)
|
||||
function test_promotes(F::Type, I::Type)
|
||||
@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), typeof(g))
|
||||
@test AbstractAlgebra.promote_rule(typeof(f), typeof(g)) == typeof(f)
|
||||
@test AbstractAlgebra.promote_rule(typeof(g), typeof(f)) == typeof(f)
|
||||
|
||||
if has_base_ring(parent(f))
|
||||
S = base_ring(parent(f))
|
||||
test_promotes(typeof(f), elem_type(S))
|
||||
@test AbstractAlgebra.promote_rule(typeof(f), elem_type(S)) == typeof(f)
|
||||
@test AbstractAlgebra.promote_rule(elem_type(S), typeof(f)) == typeof(f)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -4,13 +4,14 @@ using AbstractAlgebra
|
||||
using GroupRings
|
||||
using SparseArrays
|
||||
|
||||
@testset "Group Rings tests" begin
|
||||
include("AARing_interface_conformance.jl")
|
||||
|
||||
@testset "Group Rings tests" begin
|
||||
include("unittests.jl")
|
||||
include("usetests.jl")
|
||||
|
||||
let
|
||||
include("AARing_interface_conformance.jl")
|
||||
|
||||
R = AbstractAlgebra.zz
|
||||
G = PermGroup(4)
|
||||
|
||||
@ -19,8 +20,6 @@ using SparseArrays
|
||||
X = rand(RG, 0.2, -3:3)
|
||||
Y = rand(RG, 0.4, -1:1)
|
||||
|
||||
# test_ringinterface(X, Y)
|
||||
test_promote_rules(X, Y)
|
||||
test_ringinterface(X, Y)
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user