...
|
...
|
@@ -97,6 +97,75 @@ func TestNewDataLayout(t *testing.T) { |
|
|
},
|
|
|
flag: Location{X: 2, Y: 2},
|
|
|
},
|
|
|
{
|
|
|
title: "全部无方向",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "1",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 1,
|
|
|
Length: 1,
|
|
|
ImageData: "2",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 2,
|
|
|
Length: 1,
|
|
|
ImageData: "3",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "4",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 1,
|
|
|
Length: 1,
|
|
|
ImageData: "5",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 2,
|
|
|
Length: 1,
|
|
|
ImageData: "6",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "7",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 1,
|
|
|
Length: 1,
|
|
|
ImageData: "8",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 2,
|
|
|
Length: 1,
|
|
|
ImageData: "9",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 2, Y: 2},
|
|
|
},
|
|
|
}
|
|
|
padding := func(cells []*domain.LayoutCell) {
|
|
|
for _, cell := range cells {
|
...
|
...
|
|