开发:增加测试用例

pull/1929/head
ChenX 2 years ago
parent 3f0743aaea
commit 7f359c03bb

@ -245,3 +245,18 @@ test('删除共面(同向)墙线', () =>
for (let c of walls[0].LidCurves) for (let c of walls[0].LidCurves)
expect(c.Length).toMatchNumberSnapshot(); expect(c.Length).toMatchNumberSnapshot();
}); });
test('z不为0时分析错误', () =>
{
let d =
{ "file": [2, "RoomWallLine", 1, 3, 8, 2, 124, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 120, 0, 2700, 7598.467587478741, -303.5140527181652, 0, 5724.050903378557, -303.5140527181652, 0, "RoomWallLine", 1, 3, 8, 2, 126, false, 1, 7, 0, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 0, true, [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, -13710.71648240625, 1], 0, 120, 0, 2700, 5776.923628395063, -1966.0055000000004, 0, 5776.923628395063, -303.5140527181652, 0], "basePt": { "x": 5716.923628395063, "y": -1966.0055000000004, "z": -13710.71648240625 }, "ucs": [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1] };
let walls = LoadEntityFromFileData<RoomWallBase>(d);
new RoomWallParse(true, undefined, false).Parse(walls);
for (let c of walls[0].LeftCurves)
expect(c.Length).toMatchNumberSnapshot();
for (let c of walls[0].RightCurves)
expect(c.Length).toMatchNumberSnapshot();
for (let c of walls[0].LidCurves)
expect(c.Length).toMatchNumberSnapshot();
});

@ -1,5 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`z不为0时分析错误 1`] = `"1761.54396"`;
exports[`z不为0时分析错误 2`] = `"1874.41668"`;
exports[`z不为0时分析错误 3`] = `"120.00000"`;
exports[`z不为0时分析错误 4`] = `"60.00000"`;
exports[`不同厚度的墙合理的延伸 1`] = ` exports[`不同厚度的墙合理的延伸 1`] = `
Array [ Array [
-1741.576246932827, -1741.576246932827,

Loading…
Cancel
Save