MCPcopy
hub / github.com/charmbracelet/bubbletea / TestTeaSequenceMsg

Function TestTeaSequenceMsg

tea_test.go:436–459  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

434}
435
436func TestTeaSequenceMsg(t *testing.T) {
437 t.Parallel()
438 var buf bytes.Buffer
439 var in bytes.Buffer
440
441 inc := func() Msg {
442 return incrementMsg{}
443 }
444
445 m := &testModel{}
446 p := NewProgram(m,
447 WithInput(&in),
448 WithOutput(&buf),
449 )
450 go p.Send(sequenceMsg{inc, inc, Quit})
451
452 if _, err := p.Run(); err != nil {
453 t.Fatal(err)
454 }
455
456 if m.counter.Load() != 2 {
457 t.Fatalf("counter should be 2, got %d", m.counter.Load())
458 }
459}
460
461func TestTeaSequenceMsgWithBatchMsg(t *testing.T) {
462 t.Parallel()

Callers

nothing calls this directly

Calls 5

SendMethod · 0.95
RunMethod · 0.95
NewProgramFunction · 0.85
WithInputFunction · 0.85
WithOutputFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…