TestValueExpandsAllChips: Value() interleaves surrounding text with full paste contents in order.
(t *testing.T)
| 254 | // TestValueExpandsAllChips: Value() interleaves surrounding text with full |
| 255 | // paste contents in order. |
| 256 | func TestValueExpandsAllChips(t *testing.T) { |
| 257 | p := newChippablePrompt() |
| 258 | paste1 := makePaste(9) |
| 259 | paste2 := makePaste(11) |
| 260 | p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune("A ")}) |
| 261 | p, _ = p.Update(pasteKey(paste1)) |
| 262 | p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(" B ")}) |
| 263 | p, _ = p.Update(pasteKey(paste2)) |
| 264 | p, _ = p.Update(tea.KeyMsg{Type: tea.KeyRunes, Runes: []rune(" C")}) |
| 265 | |
| 266 | want := "A " + paste1 + " B " + paste2 + " C" |
| 267 | if got := p.Value(); got != want { |
| 268 | t.Fatalf("Value expansion wrong:\nwant %q\ngot %q", want, got) |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | // TestTypingShiftsSpans: typing before a chip shifts its span right by one; |
| 273 | // reconcile tracks it automatically. |
nothing calls this directly
no test coverage detected