|
@@ -97,6 +97,75 @@ func TestNewDataLayout(t *testing.T) { |
|
@@ -97,6 +97,75 @@ func TestNewDataLayout(t *testing.T) { |
97
|
},
|
97
|
},
|
98
|
flag: Location{X: 2, Y: 2},
|
98
|
flag: Location{X: 2, Y: 2},
|
99
|
},
|
99
|
},
|
|
|
100
|
+ {
|
|
|
101
|
+ title: "全部无方向",
|
|
|
102
|
+ cells: []*domain.LayoutCell{
|
|
|
103
|
+ {
|
|
|
104
|
+ X: 0,
|
|
|
105
|
+ Y: 0,
|
|
|
106
|
+ Length: 1,
|
|
|
107
|
+ ImageData: "1",
|
|
|
108
|
+ Direction: domain.DirectionNone,
|
|
|
109
|
+ },
|
|
|
110
|
+ {
|
|
|
111
|
+ X: 0,
|
|
|
112
|
+ Y: 1,
|
|
|
113
|
+ Length: 1,
|
|
|
114
|
+ ImageData: "2",
|
|
|
115
|
+ Direction: domain.DirectionNone,
|
|
|
116
|
+ },
|
|
|
117
|
+ {
|
|
|
118
|
+ X: 0,
|
|
|
119
|
+ Y: 2,
|
|
|
120
|
+ Length: 1,
|
|
|
121
|
+ ImageData: "3",
|
|
|
122
|
+ Direction: domain.DirectionNone,
|
|
|
123
|
+ },
|
|
|
124
|
+ {
|
|
|
125
|
+ X: 1,
|
|
|
126
|
+ Y: 0,
|
|
|
127
|
+ Length: 1,
|
|
|
128
|
+ ImageData: "4",
|
|
|
129
|
+ Direction: domain.DirectionNone,
|
|
|
130
|
+ },
|
|
|
131
|
+ {
|
|
|
132
|
+ X: 1,
|
|
|
133
|
+ Y: 1,
|
|
|
134
|
+ Length: 1,
|
|
|
135
|
+ ImageData: "5",
|
|
|
136
|
+ Direction: domain.DirectionNone,
|
|
|
137
|
+ },
|
|
|
138
|
+ {
|
|
|
139
|
+ X: 1,
|
|
|
140
|
+ Y: 2,
|
|
|
141
|
+ Length: 1,
|
|
|
142
|
+ ImageData: "6",
|
|
|
143
|
+ Direction: domain.DirectionNone,
|
|
|
144
|
+ },
|
|
|
145
|
+ {
|
|
|
146
|
+ X: 2,
|
|
|
147
|
+ Y: 0,
|
|
|
148
|
+ Length: 1,
|
|
|
149
|
+ ImageData: "7",
|
|
|
150
|
+ Direction: domain.DirectionNone,
|
|
|
151
|
+ },
|
|
|
152
|
+ {
|
|
|
153
|
+ X: 2,
|
|
|
154
|
+ Y: 1,
|
|
|
155
|
+ Length: 1,
|
|
|
156
|
+ ImageData: "8",
|
|
|
157
|
+ Direction: domain.DirectionDown,
|
|
|
158
|
+ },
|
|
|
159
|
+ {
|
|
|
160
|
+ X: 2,
|
|
|
161
|
+ Y: 2,
|
|
|
162
|
+ Length: 1,
|
|
|
163
|
+ ImageData: "9",
|
|
|
164
|
+ Direction: domain.DirectionNone,
|
|
|
165
|
+ },
|
|
|
166
|
+ },
|
|
|
167
|
+ flag: Location{X: 2, Y: 2},
|
|
|
168
|
+ },
|
100
|
}
|
169
|
}
|
101
|
padding := func(cells []*domain.LayoutCell) {
|
170
|
padding := func(cells []*domain.LayoutCell) {
|
102
|
for _, cell := range cells {
|
171
|
for _, cell := range cells {
|