推进 OPFS G-code 程序路径 helper
This commit is contained in:
@@ -25,6 +25,7 @@ import {
|
||||
validateSessionSnapshot,
|
||||
} from "../../../runtime/opfs/snapshot-store.js";
|
||||
import {
|
||||
gcodeFilenameFromProgramPath,
|
||||
loadGcodeProgram,
|
||||
loadMachineTextFiles,
|
||||
machineFilePaths,
|
||||
@@ -201,6 +202,18 @@ assertGcodeProgramStoragePath(
|
||||
"custom-fixture.ngc",
|
||||
gcodeProgramPath("custom-fixture.ngc"),
|
||||
);
|
||||
assert.equal(
|
||||
gcodeFilenameFromProgramPath("linuxcnc/gcode/fixture.ngc"),
|
||||
"fixture.ngc",
|
||||
);
|
||||
assert.throws(
|
||||
() => gcodeFilenameFromProgramPath("linuxcnc/machines/xyzab-tdr/fixture.ngc"),
|
||||
/Invalid G-code program OPFS path/,
|
||||
);
|
||||
assert.throws(
|
||||
() => gcodeFilenameFromProgramPath("linuxcnc/gcode/nested/fixture.ngc"),
|
||||
/Invalid G-code program OPFS path/,
|
||||
);
|
||||
assertPreviewCacheStoragePath("fixture", previewCachePath("fixture"));
|
||||
assertPreviewCacheStoragePath(
|
||||
"fixture",
|
||||
|
||||
Reference in New Issue
Block a user