mirror of
https://github.com/affaan-m/ECC.git
synced 2026-09-26 03:25:09 +02:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user