feudal/interrogator/interrogator_test.go
Matthew Rich 1b9d1b1fb1
Some checks failed
Declarative Tests / test (push) Waiting to run
Lint / golangci-lint (push) Has been cancelled
add context
2024-05-05 00:11:52 -07:00

29 lines
504 B
Go

// 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")
}
}