github.com/koko1123/flow-go-1@v0.29.6/module/irrecoverable/unittest.go (about)

     1  package irrecoverable
     2  
     3  import (
     4  	"context"
     5  	"testing"
     6  )
     7  
     8  type MockSignalerContext struct {
     9  	context.Context
    10  	t *testing.T
    11  }
    12  
    13  var _ SignalerContext = &MockSignalerContext{}
    14  
    15  func (m MockSignalerContext) sealed() {}
    16  
    17  func (m MockSignalerContext) Throw(err error) {
    18  	m.t.Fatalf("mock signaler context received error: %v", err)
    19  }
    20  
    21  func NewMockSignalerContext(t *testing.T, ctx context.Context) *MockSignalerContext {
    22  	return &MockSignalerContext{
    23  		Context: ctx,
    24  		t:       t,
    25  	}
    26  }