From b52de81e060cc3ff1c5d60ed385b6a1c68a162f6 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Wed, 15 Mar 2023 18:28:10 +0100 Subject: [PATCH] update tests for show for SLn, Spn --- test/matrix_groups.jl | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/test/matrix_groups.jl b/test/matrix_groups.jl index ef27c9d..4e99f04 100644 --- a/test/matrix_groups.jl +++ b/test/matrix_groups.jl @@ -7,7 +7,7 @@ using Groups.MatrixGroups S = gens(SL3Z) union!(S, inv.(S)) - _, sizes = Groups.wlmetric_ball(S, radius=4) + _, sizes = Groups.wlmetric_ball(S; radius = 4) @test sizes == [13, 121, 883, 5455] @@ -20,9 +20,9 @@ using Groups.MatrixGroups S = [w, r, s] S = unique([S; inv.(S)]) - _, sizes = Groups.wlmetric_ball(S, radius=4) + _, sizes = Groups.wlmetric_ball(S; radius = 4) @test sizes == [7, 33, 141, 561] - _, sizes = Groups.wlmetric_ball_serial(S, radius=4) + _, sizes = Groups.wlmetric_ball_serial(S; radius = 4) @test sizes == [7, 33, 141, 561] Logging.with_logger(Logging.NullLogger()) do @@ -35,15 +35,18 @@ using Groups.MatrixGroups end end - x = w * inv(w) * r @test length(word(x)) == 5 @test size(x) == (3, 3) @test eltype(x) == Int8 - @test contains(sprint(print, SL3Z), "special linear group of 3×3") - @test contains(sprint(show, MIME"text/plain"(), x), "SL{3,Int8} matrix:") + @test contains(sprint(show, SL3Z), "SL{3,Int8}") + @test contains( + sprint(show, MIME"text/plain"(), SL3Z), + "special linear group", + ) + @test contains(sprint(show, MIME"text/plain"(), x), "∈ SL{3,Int8}") @test sprint(print, x) isa String @test length(word(x)) == 3 @@ -62,8 +65,6 @@ using Groups.MatrixGroups end end - @test contains(sprint(print, Sp6), "group of 6×6 symplectic matrices") - x = gens(Sp6, 1) x *= inv(x) * gens(Sp6, 2) @@ -71,13 +72,18 @@ using Groups.MatrixGroups @test size(x) == (6, 6) @test eltype(x) == Int8 - @test contains(sprint(show, MIME"text/plain"(), x), "6×6 symplectic matrix:") + @test contains(sprint(show, Sp6), "Sp{6,Int8}") + @test contains( + sprint(show, MIME"text/plain"(), Sp6), + "group of 6×6 symplectic matrices", + ) + @test contains(sprint(show, MIME"text/plain"(), x), "∈ Sp{6,Int8}") @test sprint(print, x) isa String @test length(word(x)) == 1 for g in gens(Sp6) - @test MatrixGroups.issymplectic(MatrixGroups.matrix_repr(g)) + @test MatrixGroups.issymplectic(MatrixGroups.matrix(g)) end end end