File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -584,7 +584,7 @@ func (t *TestWorkflowEnvironment) GetWorkflowResult(valuePtr interface{}) error
584
584
if ! t .impl .isTestCompleted {
585
585
panic ("workflow is not completed" )
586
586
}
587
- if t .impl .testError != nil || t .impl .testResult == nil || valuePtr == nil {
587
+ if t .impl .testError != nil || t .impl .testResult == nil || t . impl . testResult . HasValue () == false || valuePtr == nil {
588
588
return t .impl .testError
589
589
}
590
590
return t .impl .testResult .Get (valuePtr )
Original file line number Diff line number Diff line change @@ -112,3 +112,23 @@ func TestNoExplicitRegistrationRequired(t *testing.T) {
112
112
require .NoError (t , err )
113
113
require .Equal (t , "Hello World!" , result )
114
114
}
115
+
116
+ func TestWorkflowReturnNil (t * testing.T ) {
117
+ testSuite := & WorkflowTestSuite {}
118
+ env := testSuite .NewTestWorkflowEnvironment ()
119
+
120
+ var isExecuted bool
121
+ testWF := func (ctx Context ) error {
122
+ isExecuted = true
123
+ return nil
124
+ }
125
+ env .ExecuteWorkflow (testWF )
126
+
127
+ require .True (t , env .IsWorkflowCompleted ())
128
+ require .NoError (t , env .GetWorkflowError ())
129
+ require .True (t , isExecuted )
130
+
131
+ var r struct {}
132
+ err := env .GetWorkflowResult (& r )
133
+ require .NoError (t , err )
134
+ }
You can’t perform that action at this time.
0 commit comments