Skip to content

Commit 00ac18b

Browse files
committed
add empty string test
1 parent fb8c685 commit 00ac18b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

dbos/serialization.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ func isGobSerializer(s Serializer) bool {
2424
}
2525

2626
// gobValue is a wrapper type for gob encoding/decoding of any value
27+
// Useful when we need to encode/decode a nil pointer or an empty string
2728
type gobValue struct {
2829
Value any
2930
}

dbos/serialization_test.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,13 @@ func runScalarsTests(t *testing.T, executor DBOSContext) {
228228
require.NoError(t, err)
229229
testRoundTrip[int, int](t, executor, h2, 42)
230230
})
231+
232+
t.Run("EmptyString", func(t *testing.T) {
233+
emptyStr := ""
234+
h3, err := RunWorkflow(executor, serializerStringWorkflow, emptyStr)
235+
require.NoError(t, err)
236+
testRoundTrip[string, string](t, executor, h3, emptyStr)
237+
})
231238
}
232239

233240
// testRoundTrip doesn't work super well for pointer types and ListWorkflows/GetWorkflowSteps

0 commit comments

Comments
 (0)