spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / diff / tests / fixtures / scripted / files-changed.ts
18 lines · 517 BRaw
1import { answersOf } from '../answers-of.js'
2
3/**
4 * Git's output in /work where that many files changed a line each.
5 *
6 * @param count how many files changed
7 * @returns the answers by key
8 */
9export const filesChanged = (count: number) =>
10 answersOf(
11 Array.from({ length: count }, (_, at) => `1\t1\tfile${at}.ts\0`).join(''),
12 Object.fromEntries(
13 Array.from({ length: count }, (_, at) => [
14 `file${at}.ts`,
15 `@@ -1 +1 @@\n-const v = ${at}\n+const v = ${at + 1}\n`,
16 ]),
17 ),
18 )