Guard browser OPFS saved text helper
This commit is contained in:
@@ -4535,13 +4535,19 @@
|
||||
);
|
||||
}
|
||||
|
||||
async function verifyOpfsSavedText(label, loadActualText, expectedText) {
|
||||
verifyExpectedOutput(label, await loadActualText(), expectedText);
|
||||
}
|
||||
|
||||
async function verifyOpfsReadback(label, opfsPath, expectedText) {
|
||||
verifyExpectedOutput(label, await loadTextFile(opfsPath), expectedText);
|
||||
await verifyOpfsSavedText(label, () => loadTextFile(opfsPath), expectedText);
|
||||
}
|
||||
|
||||
async function verifyOpfsMachineFileReadback(label, machineId, fileKey, expectedText) {
|
||||
const machineFiles = await loadMachineTextFiles(machineId);
|
||||
verifyExpectedOutput(label, machineFiles[fileKey], expectedText);
|
||||
await verifyOpfsSavedText(label, async () => {
|
||||
const machineFiles = await loadMachineTextFiles(machineId);
|
||||
return machineFiles[fileKey];
|
||||
}, expectedText);
|
||||
}
|
||||
|
||||
async function writeOpfsMachineFile(machineId, filename, text) {
|
||||
@@ -9524,9 +9530,9 @@
|
||||
"5399\t199.000000",
|
||||
].join("\n"),
|
||||
);
|
||||
await verifyOpfsReadback(
|
||||
await verifyOpfsSavedText(
|
||||
"opfs_saved_ini_named_parameter_backup_text",
|
||||
savedIniNamedParameters.backupOpfsPath,
|
||||
() => loadTextFile(savedIniNamedParameters.backupOpfsPath),
|
||||
[
|
||||
"5161 31.25",
|
||||
"5162 62.5",
|
||||
@@ -9570,9 +9576,9 @@
|
||||
"tool_1.pocketno=8",
|
||||
].join("\n"),
|
||||
);
|
||||
await verifyOpfsReadback(
|
||||
await verifyOpfsSavedText(
|
||||
"opfs_saved_ini_named_tool_table_text",
|
||||
loadedIniFileSession.toolTable.opfsPath,
|
||||
() => loadTextFile(loadedIniFileSession.toolTable.opfsPath),
|
||||
[
|
||||
"T8",
|
||||
"P8",
|
||||
@@ -9700,9 +9706,9 @@
|
||||
"parameter_5399=202",
|
||||
].join("\n"),
|
||||
);
|
||||
await verifyOpfsReadback(
|
||||
await verifyOpfsSavedText(
|
||||
"opfs_saved_explicit_parameter_text",
|
||||
loadedIniOverrideSession.parameters.opfsPath,
|
||||
() => loadTextFile(loadedIniOverrideSession.parameters.opfsPath),
|
||||
[
|
||||
"5161\t51.250000",
|
||||
"5162\t102.500000",
|
||||
@@ -9710,9 +9716,9 @@
|
||||
"5399\t202.000000",
|
||||
].join("\n"),
|
||||
);
|
||||
await verifyOpfsReadback(
|
||||
await verifyOpfsSavedText(
|
||||
"opfs_saved_explicit_parameter_backup_text",
|
||||
savedExplicitParameters.backupOpfsPath,
|
||||
() => loadTextFile(savedExplicitParameters.backupOpfsPath),
|
||||
[
|
||||
"5161 41.25",
|
||||
"5162 82.5",
|
||||
@@ -9744,9 +9750,9 @@
|
||||
"tool_1.pocketno=9",
|
||||
].join("\n"),
|
||||
);
|
||||
await verifyOpfsReadback(
|
||||
await verifyOpfsSavedText(
|
||||
"opfs_saved_explicit_tool_table_text",
|
||||
loadedIniOverrideSession.toolTable.opfsPath,
|
||||
() => loadTextFile(loadedIniOverrideSession.toolTable.opfsPath),
|
||||
[
|
||||
"T9",
|
||||
"P9",
|
||||
|
||||
Reference in New Issue
Block a user