diff --git a/wasm-port/docs/compatibility-validation.md b/wasm-port/docs/compatibility-validation.md index 27608eb..0b4b61d 100644 --- a/wasm-port/docs/compatibility-validation.md +++ b/wasm-port/docs/compatibility-validation.md @@ -295,7 +295,8 @@ restore/save behavior through the exported C ABI, including out-of-order file rejection, missing-file success, missing required numeric parameter defaulting, required numeric parameter writeback, removal of named-parameter-only lines from saved output, and the `.bak` backup produced by vendored -`save_parameters()`. It also covers LinuxCNC tool-table +`save_parameters()`, including browser OPFS readback of the backup text after +the host bridge writes it to persistent storage. It also covers LinuxCNC tool-table load/save behavior through vendored `tooldata_common.cc`, including the non-random and random-toolchanger `tooldata_init()` branches, with the SDK only copying text into the Emscripten filesystem and calling the exported C diff --git a/wasm-port/tests/browser/interp_smoke.html b/wasm-port/tests/browser/interp_smoke.html index dc06a57..d074792 100644 --- a/wasm-port/tests/browser/interp_smoke.html +++ b/wasm-port/tests/browser/interp_smoke.html @@ -15,6 +15,7 @@ saveMachineParametersToOpfs, } from "../../runtime/opfs/linuxcnc-parameter-bridge.js"; import { + loadTextFile, saveTextFile, } from "../../runtime/opfs/file-service.js"; import { @@ -384,6 +385,23 @@ "absent=<_named_param>", ].join("\n"), ); + if ( + savedParameters.backupOpfsPath !== + "linuxcnc/machines/browser-interp/linuxcnc.var.bak" + ) { + throw new Error(`unexpected parameter backup path: ${savedParameters.backupOpfsPath}`); + } + verifyExpectedOutput( + "opfs_saved_parameter_backup_text", + await loadTextFile(savedParameters.backupOpfsPath), + [ + "5161 10.5", + "5162 20.25", + "5221 2.25", + "5399 44", + "<_named_param> 123", + ].join("\n"), + ); const savedToolTable = await saveMachineToolTableToOpfs( interp, "browser-interp",