推进 INI 面板 session load summary helper
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
import assert from "node:assert/strict";
|
||||
|
||||
import {
|
||||
createMachineSessionLoadSummary,
|
||||
machineSessionLoadLogLines,
|
||||
} from "../../../runtime/ui/ini-panel/session-load-summary.js";
|
||||
import {
|
||||
createSessionSnapshotSummary,
|
||||
sessionSnapshotMetadataLogLines,
|
||||
@@ -71,4 +75,56 @@ assert.deepEqual(
|
||||
},
|
||||
);
|
||||
|
||||
const loadSummary = createMachineSessionLoadSummary({
|
||||
ini: {
|
||||
opfsPath: "linuxcnc/machines/xyzab-tdr/machine.ini",
|
||||
wasmPath: "/work/session-machine.ini",
|
||||
},
|
||||
parameters: {
|
||||
opfsPath: "linuxcnc/machines/xyzab-tdr/linuxcnc.var",
|
||||
wasmPath: "/work/session-linuxcnc.var",
|
||||
result: "restore_parameters=0",
|
||||
},
|
||||
toolTable: {
|
||||
opfsPath: "linuxcnc/machines/xyzab-tdr/tool.tbl",
|
||||
wasmPath: "/work/session-tool.tbl",
|
||||
result: "tooldata_load=0",
|
||||
},
|
||||
});
|
||||
assert.deepEqual(loadSummary, {
|
||||
iniOpfsPath: "linuxcnc/machines/xyzab-tdr/machine.ini",
|
||||
iniWasmPath: "/work/session-machine.ini",
|
||||
parameterOpfsPath: "linuxcnc/machines/xyzab-tdr/linuxcnc.var",
|
||||
parameterWasmPath: "/work/session-linuxcnc.var",
|
||||
parameterResult: "restore_parameters=0",
|
||||
toolTableOpfsPath: "linuxcnc/machines/xyzab-tdr/tool.tbl",
|
||||
toolTableWasmPath: "/work/session-tool.tbl",
|
||||
toolTableResult: "tooldata_load=0",
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
machineSessionLoadLogLines(loadSummary),
|
||||
[
|
||||
"INI: linuxcnc/machines/xyzab-tdr/machine.ini -> /work/session-machine.ini",
|
||||
"Parameter file: linuxcnc/machines/xyzab-tdr/linuxcnc.var -> /work/session-linuxcnc.var",
|
||||
"Parameters: restore_parameters=0",
|
||||
"Tool table file: linuxcnc/machines/xyzab-tdr/tool.tbl -> /work/session-tool.tbl",
|
||||
"Tool table: tooldata_load=0",
|
||||
],
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
createMachineSessionLoadSummary(null),
|
||||
{
|
||||
iniOpfsPath: null,
|
||||
iniWasmPath: null,
|
||||
parameterOpfsPath: null,
|
||||
parameterWasmPath: null,
|
||||
parameterResult: "",
|
||||
toolTableOpfsPath: null,
|
||||
toolTableWasmPath: null,
|
||||
toolTableResult: "",
|
||||
},
|
||||
);
|
||||
|
||||
console.log("ini_panel_session_summary_node_smoke=ok");
|
||||
|
||||
Reference in New Issue
Block a user