MCPcopy
hub / github.com/Doorman11991/smallcode / format

Method format

bin/eval_runner.js:146–158  ·  view source on GitHub ↗

* Format results for display.

(results)

Source from the content-addressed store, hash-verified

144 * Format results for display.
145 */
146 static format(results) {
147 const lines = [
148 ` ${results.name}`,
149 ` Score: ${results.score}`,
150 ` ${'─'.repeat(40)}`,
151 ];
152 for (const c of results.cases) {
153 const mark = c.passed ? '✓' : '✗';
154 const color = c.passed ? '\x1b[32m' : '\x1b[31m';
155 lines.push(` ${color}${mark}\x1b[0m ${c.input.slice(0, 50)} → ${c.got || '?'}${c.expected ? ` (exp: ${c.expected})` : ''}`);
156 }
157 return lines.join('\n');
158 }
159}
160
161module.exports = { EvalRunner, BUILTIN_SUITES };

Callers 2

mainFunction · 0.80
commands.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected