Skip to content
Myr

test: add sequenceMsg test

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Muehlhaeuser · committed by Christian Muehlhaeuser · parent 9117bbc · Browse files · 1 file+22 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+22 added−1 removed

  • other:+22 added−1 removed

1 file+22 added−1 removed

modified:tea_test.go+22 added-1 removed
123 unmodified lines
124 t.Fatal(err)125 }126127 if m.counter.Load() != 2 {128 t.Fatalf("counter should be 2, got %d", m.counter)128 t.Fatalf("counter should be 2, got %d", m.counter.Load())129 }130}131132func TestTeaSequenceMsg(t *testing.T) {133 var buf bytes.Buffer134 var in bytes.Buffer135136 inc := func() Msg {137 return incrementMsg{}138 }139140 m := &testModel{}141 p := NewProgram(m, WithInput(&in), WithOutput(&buf))142 go p.Send(sequenceMsg{inc, inc, Quit})143144 if _, err := p.Run(); err != nil {145 t.Fatal(err)146 }147148 if m.counter.Load() != 2 {149 t.Fatalf("counter should be 2, got %d", m.counter.Load())150 }151}