refactor: simplify memory command dispatch

Split memory CLI actions into focused handlers, keep dispatch below the project function-size guideline, and strengthen install-manifest assertions for the separately installed runtime.
This commit is contained in:
Affaan Mustafa
2026-07-26 05:01:27 -04:00
parent c64875d9c6
commit 27b7c673e2
3 changed files with 78 additions and 47 deletions
+10 -1
View File
@@ -8,7 +8,11 @@ const { spawnSync } = require('child_process');
const MEMORY_SCRIPT = path.join(__dirname, '..', '..', 'scripts', 'memory.js');
const ECC_SCRIPT = path.join(__dirname, '..', '..', 'scripts', 'ecc.js');
const { readBoundedStdin, sanitizeTerminalText } = require(MEMORY_SCRIPT);
const {
readBoundedStdin,
runCommand,
sanitizeTerminalText,
} = require(MEMORY_SCRIPT);
let passed = 0;
let failed = 0;
@@ -62,6 +66,11 @@ function json(result) {
console.log('\n=== Testing ecc memory CLI ===\n');
test('keeps runCommand focused on dispatch under the function-size guideline', () => {
const lineCount = runCommand.toString().split('\n').length;
assert.ok(lineCount < 50, `runCommand is ${lineCount} lines; expected fewer than 50`);
});
test('shows memory command help directly and through the ecc router', () => {
const fixture = createFixture();
try {