run: make minimal mode more minimal (#31227)
This commit is contained in:
parent
914a643ab2
commit
07808bea12
39 changed files with 3109 additions and 930 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { afterEach, expect, test } from "bun:test"
|
||||
import { openEditor } from "../src/editor"
|
||||
import { normalizePromptContent, openEditor } from "../src/editor"
|
||||
|
||||
const editor = process.env.EDITOR
|
||||
const visual = process.env.VISUAL
|
||||
|
|
@ -21,3 +21,12 @@ test("rejects when the external editor cannot start", async () => {
|
|||
|
||||
await expect(openEditor({ value: "original", renderer: renderer as never })).rejects.toThrow()
|
||||
})
|
||||
|
||||
test("normalizes a single trailing editor newline for one-line prompts", () => {
|
||||
expect(normalizePromptContent("hello\n")).toBe("hello")
|
||||
expect(normalizePromptContent("hello\r\n")).toBe("hello")
|
||||
})
|
||||
|
||||
test("preserves multiline prompts that end with a newline", () => {
|
||||
expect(normalizePromptContent("hello\nworld\n")).toBe("hello\nworld\n")
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue