diff --git a/revid/senders_test.go b/revid/senders_test.go index a5478899..15af7a1d 100644 --- a/revid/senders_test.go +++ b/revid/senders_test.go @@ -249,3 +249,19 @@ func TestMtsSenderDiscontinuity(t *testing.T) { t.Fatalf("Did not get discontinuity indicator for PAT") } } + +// TestNewMultiSender checks that newMultiSender performs as expected when an +// active function is not provided, and when an active function is provided. +func TestNewMultiSender(t *testing.T) { + // First test without giving an 'active' function. + _, err := newMultiSender(nil, false, nil) + if err == nil { + t.Error("did not get expected error on creation of multiSender without active function") + } + + // Now test with providing an active function + _, err = newMultiSender(nil, false, func() bool { return true }) + if err != nil { + t.Errorf("did not expect to get error on creation of multiSender with active func provided, err: %v", err) + } +}