TestMultipatch_Base64Encoding exercises the encoding=base64 path so the LLM can ship binary-ish payloads (control chars, non-UTF8) via a single JSON envelope.
(t *testing.T)
| 201 | // the LLM can ship binary-ish payloads (control chars, non-UTF8) via |
| 202 | // a single JSON envelope. |
| 203 | func TestMultipatch_Base64Encoding(t *testing.T) { |
| 204 | dir := t.TempDir() |
| 205 | path := writeFile(t, dir, "b.txt", "abc\ndef") |
| 206 | eng, _, _ := newTestEngine(t, dir) |
| 207 | |
| 208 | // base64("abc\ndef") = "YWJjCmRlZg==" |
| 209 | // base64("XYZ\n123") = "WFlaCjEyMw==" |
| 210 | editsJSON := `[{"file":"` + path + `","search":"YWJjCmRlZg==","replace":"WFlaCjEyMw==","encoding":"base64"}]` |
| 211 | err := eng.Execute(context.Background(), "multipatch", []string{"--edits", editsJSON}) |
| 212 | require.NoError(t, err) |
| 213 | assert.Equal(t, "XYZ\n123", readFile(t, path)) |
| 214 | } |
| 215 | |
| 216 | // TestMultipatch_PerFileLockSerializesConcurrentTx is the key |
| 217 | // concurrency guarantee: two multipatches targeting the same file |
nothing calls this directly
no test coverage detected