feudal/interrogator/interrogator_test.go

29 lines
504 B
Go
Raw Normal View History

2024-05-05 07:11:52 +00:00
// Copyright 2024 Matthew Rich <matthewrich.conf@gmail.com>. All rights reserved.
package interrogator;
import (
"testing"
"feudal/message"
)
func TestInterrogator(t *testing.T) {
i := New()
m := message.New("foo", i)
go i.Send(m)
r := <- i
if r.Body() != "foo" {
t.Errorf("Invalid message")
}
}
func TestBufferedInterrogator(t *testing.T) {
i := NewBuffered(1)
m := message.New("foo", i)
i.Send(m)
r := <- i
if r.Body() != "foo" {
t.Errorf("Invalid message")
}
}