...
|
...
|
@@ -75,456 +75,398 @@ func TestDataLayout(t *testing.T) { |
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
|
|
|
//分组二 右平移10
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 10,
|
|
|
Length: 2,
|
|
|
ImageData: "2",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 11,
|
|
|
Length: 3,
|
|
|
ImageData: "3",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 10,
|
|
|
Length: 2,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 11,
|
|
|
Length: 2,
|
|
|
ImageData: "f",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 12,
|
|
|
Length: 2,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 13,
|
|
|
Length: 2,
|
|
|
ImageData: "e",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 10,
|
|
|
Length: 1,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 11,
|
|
|
Length: 1,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 2, Y: 2},
|
|
|
},
|
|
|
{
|
|
|
title: "正常多字段横排",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 3,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
|
|
|
// 分组二 平移10
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 10,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 10,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 10,
|
|
|
Length: 5,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 3,
|
|
|
Y: 10,
|
|
|
Length: 5,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 3, Y: 4},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: "正常多字段横排+计算项目",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 3,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
|
|
|
// 分组二 平移10
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 10,
|
|
|
Length: 1,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 10,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 10,
|
|
|
Length: 1,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 11,
|
|
|
Length: 1,
|
|
|
ImageData: "e",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 3,
|
|
|
Y: 10,
|
|
|
Length: 1,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 2, Y: 1},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: "正常多字段横排+竖排",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 1,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 2, Y: 1},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: "正常多字段横排(长度不一样)+竖排",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 1,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 0,
|
|
|
Length: 6,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 0,
|
|
|
Length: 7,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 2, Y: 1},
|
|
|
},
|
|
|
|
|
|
{
|
|
|
title: "测试用例1",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 1,
|
|
|
Length: 1,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 2,
|
|
|
Length: 5,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 0, Y: 0},
|
|
|
},
|
|
|
{
|
|
|
title: "测试用例3",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 1,
|
|
|
Length: 5,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 1,
|
|
|
Length: 5,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 2, Y: 1},
|
|
|
},
|
|
|
{
|
|
|
title: "测试用例4",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 1,
|
|
|
Length: 5,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
// ,
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
},
|
|
|
flag: Location{X: 0, Y: 0},
|
|
|
},
|
|
|
{
|
|
|
title: "测试用例5",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 5,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 1,
|
|
|
Length: 6,
|
|
|
ImageData: "b",
|
|
|
Direction: domain.DirectionDown,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "t",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 1,
|
|
|
Length: 1,
|
|
|
ImageData: "x",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
// ,
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
},
|
|
|
flag: Location{X: 0, Y: 0},
|
|
|
debug:true,
|
|
|
},
|
|
|
{
|
|
|
title: "测试用例6",
|
|
|
cells: []*domain.LayoutCell{
|
|
|
// 分组一
|
|
|
{
|
|
|
X: 0,
|
|
|
Y: 0,
|
|
|
Length: 1,
|
|
|
ImageData: "a",
|
|
|
Direction: domain.DirectionNone,
|
|
|
},
|
|
|
{
|
|
|
X: 1,
|
|
|
Y: 1,
|
|
|
Length: 5,
|
|
|
ImageData: "c",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
{
|
|
|
X: 2,
|
|
|
Y: 1,
|
|
|
Length: 5,
|
|
|
ImageData: "d",
|
|
|
Direction: domain.DirectionRight,
|
|
|
},
|
|
|
},
|
|
|
flag: Location{X: 0, Y: 0},
|
|
|
},
|
|
|
//{
|
|
|
// title: "正常多字段横排",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 3,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
//
|
|
|
// // 分组二 平移10
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 10,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 10,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 10,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 3,
|
|
|
// Y: 10,
|
|
|
// Length: 5,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// },
|
|
|
// flag: Location{X: 3, Y: 4},
|
|
|
//},
|
|
|
//
|
|
|
//{
|
|
|
// title: "正常多字段横排+计算项目",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 0,
|
|
|
// Length: 1,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 3,
|
|
|
// Y: 0,
|
|
|
// Length: 1,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
//
|
|
|
// // 分组二 平移10
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 10,
|
|
|
// Length: 1,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 10,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 10,
|
|
|
// Length: 1,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 11,
|
|
|
// Length: 1,
|
|
|
// ImageData: "e",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 3,
|
|
|
// Y: 10,
|
|
|
// Length: 1,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// },
|
|
|
// flag: Location{X: 2, Y: 1},
|
|
|
//},
|
|
|
//
|
|
|
//{
|
|
|
// title: "正常多字段横排+竖排",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionDown,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// },
|
|
|
// flag: Location{X: 2, Y: 1},
|
|
|
//},
|
|
|
//
|
|
|
//{
|
|
|
// title: "正常多字段横排(长度不一样)+竖排",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionDown,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 0,
|
|
|
// Length: 6,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 0,
|
|
|
// Length: 7,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// },
|
|
|
// flag: Location{X: 2, Y: 1},
|
|
|
//},
|
|
|
//
|
|
|
//{
|
|
|
// title: "测试用例1",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 1,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 1,
|
|
|
// Length: 1,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 2,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// },
|
|
|
// flag: Location{X: 0, Y: 0},
|
|
|
//},
|
|
|
//{
|
|
|
// title: "测试用例3",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionDown,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// },
|
|
|
// flag: Location{X: 2, Y: 1},
|
|
|
//},
|
|
|
//{
|
|
|
// title: "测试用例4",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionDown,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionDown,
|
|
|
// },
|
|
|
// // ,
|
|
|
// // {
|
|
|
// // X: 1,
|
|
|
// // Y: 1,
|
|
|
// // Length: 5,
|
|
|
// // ImageData: "c",
|
|
|
// // Direction: domain.DirectionRight,
|
|
|
// // },
|
|
|
// // {
|
|
|
// // X: 2,
|
|
|
// // Y: 1,
|
|
|
// // Length: 5,
|
|
|
// // ImageData: "d",
|
|
|
// // Direction: domain.DirectionRight,
|
|
|
// // },
|
|
|
// },
|
|
|
// flag: Location{X: 0, Y: 0},
|
|
|
//},
|
|
|
//{
|
|
|
// title: "测试用例5",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 5,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionDown,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 1,
|
|
|
// Length: 6,
|
|
|
// ImageData: "b",
|
|
|
// Direction: domain.DirectionDown,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 0,
|
|
|
// Length: 1,
|
|
|
// ImageData: "t",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 1,
|
|
|
// Length: 1,
|
|
|
// ImageData: "x",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// // ,
|
|
|
// // {
|
|
|
// // X: 1,
|
|
|
// // Y: 1,
|
|
|
// // Length: 5,
|
|
|
// // ImageData: "c",
|
|
|
// // Direction: domain.DirectionRight,
|
|
|
// // },
|
|
|
// // {
|
|
|
// // X: 2,
|
|
|
// // Y: 1,
|
|
|
// // Length: 5,
|
|
|
// // ImageData: "d",
|
|
|
// // Direction: domain.DirectionRight,
|
|
|
// // },
|
|
|
// },
|
|
|
// flag: Location{X: 0, Y: 0},
|
|
|
// debug:true,
|
|
|
//},
|
|
|
//{
|
|
|
// title: "测试用例6",
|
|
|
// cells: []*domain.LayoutCell{
|
|
|
// // 分组一
|
|
|
// {
|
|
|
// X: 0,
|
|
|
// Y: 0,
|
|
|
// Length: 1,
|
|
|
// ImageData: "a",
|
|
|
// Direction: domain.DirectionNone,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 1,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "c",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// {
|
|
|
// X: 2,
|
|
|
// Y: 1,
|
|
|
// Length: 5,
|
|
|
// ImageData: "d",
|
|
|
// Direction: domain.DirectionRight,
|
|
|
// },
|
|
|
// },
|
|
|
// flag: Location{X: 0, Y: 0},
|
|
|
//},
|
|
|
}
|
|
|
padding := func(cells []*domain.LayoutCell) {
|
|
|
for _, cell := range cells {
|
...
|
...
|
@@ -533,9 +475,9 @@ func TestDataLayout(t *testing.T) { |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
debugItem:= false
|
|
|
debugItem := false
|
|
|
for _, input := range inputs {
|
|
|
if debugItem && !input.debug{
|
|
|
if debugItem && !input.debug {
|
|
|
continue
|
|
|
}
|
|
|
padding(input.cells)
|
...
|
...
|
|