1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-19 14:35:28 +01:00

use NullLogger to suppress warnings

This commit is contained in:
Marek Kaluba 2022-04-02 15:51:29 +02:00
parent 93d97ff75f
commit 9e867a58e6
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
7 changed files with 31 additions and 16 deletions

View File

@ -8,6 +8,7 @@ Folds = "41a02a25-b8f0-4f67-bc48-60067656b558"
GroupsCore = "d5909c97-4eac-4ecc-a3dc-fdd0858a4120" GroupsCore = "d5909c97-4eac-4ecc-a3dc-fdd0858a4120"
KnuthBendix = "c2604015-7b3d-4a30-8a26-9074551ec60a" KnuthBendix = "c2604015-7b3d-4a30-8a26-9074551ec60a"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
PermutationGroups = "8bc5a954-2dfc-11e9-10e6-cd969bffa420" PermutationGroups = "8bc5a954-2dfc-11e9-10e6-cd969bffa420"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

View File

@ -1,6 +1,7 @@
module Groups module Groups
import Folds import Folds
import Logging
using GroupsCore using GroupsCore
import GroupsCore.Random import GroupsCore.Random

View File

@ -10,7 +10,10 @@ function SpecialAutomorphismGroup(F::FreeGroup; ordering = KnuthBendix.LenLex, k
maxrules = 1000*n maxrules = 1000*n
rws = KnuthBendix.RewritingSystem(rels, ordering(A)) rws = KnuthBendix.RewritingSystem(rels, ordering(A))
Logging.with_logger(Logging.NullLogger()) do
# the rws is not confluent, let's suppress warning about it
KnuthBendix.knuthbendix!(rws; maxrules=maxrules, kwargs...) KnuthBendix.knuthbendix!(rws; maxrules=maxrules, kwargs...)
end
return AutomorphismGroup(F, S, rws, ntuple(i -> gens(F, i), n)) return AutomorphismGroup(F, S, rws, ntuple(i -> gens(F, i), n))
end end

View File

@ -176,6 +176,7 @@
) )
end end
Logging.with_logger(Logging.NullLogger()) do
@testset "GroupsCore conformance" begin @testset "GroupsCore conformance" begin
test_Group_interface(A) test_Group_interface(A)
g = A(rand(1:length(alphabet(A)), 10)) g = A(rand(1:length(alphabet(A)), 10))
@ -183,5 +184,5 @@
test_GroupElement_interface(g, h) test_GroupElement_interface(g, h)
end end
end
end end

View File

@ -54,9 +54,14 @@
Groups.normalform!(h) Groups.normalform!(h)
@test h == H([5]) @test h == H([5])
@test_logs (:warn, "using generic isfiniteorder(::AbstractFPGroupElement): the returned `false` might be wrong") isfiniteorder(h)
@test_logs (:warn, "using generic isfinite(::AbstractFPGroup): the returned `false` might be wrong") isfinite(H)
Logging.with_logger(Logging.NullLogger()) do
@testset "GroupsCore conformance: H" begin @testset "GroupsCore conformance: H" begin
test_Group_interface(H) test_Group_interface(H)
test_GroupElement_interface(rand(H, 2)...) test_GroupElement_interface(rand(H, 2)...)
end end
end
end end

View File

@ -23,12 +23,14 @@ using Groups.MatrixGroups
_, sizes = Groups.wlmetric_ball_serial(S, radius=4); _, sizes = Groups.wlmetric_ball_serial(S, radius=4);
@test sizes == [7, 33, 141, 561] @test sizes == [7, 33, 141, 561]
Logging.with_logger(Logging.NullLogger()) do
@testset "GroupsCore conformance" begin @testset "GroupsCore conformance" begin
test_Group_interface(SL3Z) test_Group_interface(SL3Z)
g = A(rand(1:length(alphabet(SL3Z)), 10)) g = SL3Z(rand(1:length(alphabet(SL3Z)), 10))
h = A(rand(1:length(alphabet(SL3Z)), 10)) h = SL3Z(rand(1:length(alphabet(SL3Z)), 10))
test_GroupElement_interface(g, h) test_GroupElement_interface(g, h)
end end
end end
end end
end

View File

@ -2,6 +2,8 @@ using Test
using Groups using Groups
using PermutationGroups using PermutationGroups
import Logging
import KnuthBendix: Word import KnuthBendix: Word
using GroupsCore using GroupsCore