开发:补充测试用例

pull/2518/MERGE
ChenX 10 months ago
parent a6494fc7e6
commit dacdcda1d1

@ -214,3 +214,48 @@ Array [
},
]
`;
exports[`宽度优先的情况下 不再适合动态规划的内容 2`] = `
Array [
Box2 {
"max": Vector2 {
"x": 1220,
"y": 1084.2889,
},
"min": Vector2 {
"x": 0,
"y": 668.6566,
},
},
Box2 {
"max": Vector2 {
"x": 354.1641,
"y": 575.6342000000001,
},
"min": Vector2 {
"x": 0,
"y": 438.7912,
},
},
Box2 {
"max": Vector2 {
"x": 262.7173,
"y": 332.111,
},
"min": Vector2 {
"x": 0,
"y": 167.1686,
},
},
Box2 {
"max": Vector2 {
"x": 1220,
"y": 646.8867,
},
"min": Vector2 {
"x": 1004.6024000000001,
"y": 444.4506,
},
},
]
`;

@ -36,11 +36,19 @@ test('宽度优先的情况下 不再适合动态规划的内容', () =>
if (equalv3(pts[0], pts[pts.length - 1]))
pts.pop();
let lir = new LargestInteriorRectangle;
lir.GetMaxRectIndexFn = LargestInteriorRectangle.GetMaxWidthFn;
let rects = lir.ParseLIR(pts.map(AsVector2));
expect(rects).toMatchSnapshot();
{
let lir = new LargestInteriorRectangle;
lir.GetMaxRectIndexFn = LargestInteriorRectangle.GetMaxWidthFn;
let rects = lir.ParseLIR(pts.map(AsVector2));
expect(rects).toMatchSnapshot();
}
{
let lir = new LargestInteriorRectangle;
lir.GetMaxRectIndexFn = LargestInteriorRectangle.GetMaxHeightFn;
let rects = lir.ParseLIR(pts.map(AsVector2));
expect(rects).toMatchSnapshot();
}
}
});

@ -0,0 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`走刀 补直线 1`] = `1`;
exports[`走刀 补直线 2`] = `"3972.21363"`;
Loading…
Cancel
Save