Skip to content

Commit d1b6872

Browse files
committed
Improve testing of Young diagram code
1 parent 5cfbd4e commit d1b6872

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/youngdiagrams.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function leglength(ξ::SkewDiagram)
7979
λ, μ = ξ
8080
m, n = length(λ), length(μ)
8181
#Construct matrix representation of diagram
82+
if m==0 return -1 end
8283
l = maximum(λ)
8384
youngdiagram=zeros(Int, m, l)
8485
for i=1:n

test/youngdiagrams.jl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,18 @@ using Combinatorics
22
using Base.Test
33

44
@test ([5,4,2,2]\[2,1]) == ([5, 4, 2, 2],[2, 1])
5+
56
@test leglength([5,4,2,2], [2,1]) == leglength(([5, 4, 2, 2],[2, 1])) == 3
7+
@test leglength([1], [1]) == -1
8+
@test leglength(Int[], Int[]) == -1
9+
610
@test isrimhook([4,3,2], [2,2,2])
711
@test !isrimhook([4,3,2], [2,2,1])
812
@test !isrimhook([4,3,2], [1,1])
9-
λ = [5,4,2,1]
10-
@test partitionsequence(λ) == [1, 0, 1, 0, 1, 1, 0, 1, 0]
11-
@test character(λ, [4,3,2,2,1]) == 0
13+
14+
let λ = [5,4,2,1]
15+
@test partitionsequence(λ) == [1, 0, 1, 0, 1, 1, 0, 1, 0]
16+
@test character(λ, [4,3,2,2,1]) == 0
17+
end
1218
@test character([1], [1]) == 1
1319

0 commit comments

Comments
 (0)