(t *testing.T)
| 434 | } |
| 435 | |
| 436 | func 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 | |
| 461 | func TestTeaSequenceMsgWithBatchMsg(t *testing.T) { |
| 462 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…