From 2b5b50ed3d53cda6cd522a9dc484d7b468924e58 Mon Sep 17 00:00:00 2001 From: Henrique Costa Date: Thu, 30 Apr 2026 15:00:54 +0200 Subject: [PATCH] test: cover empty EndEvent return serialization Symptom: the regression test named as empty EndEvent coverage used the literal string "empty", so it did not prove how the writer serializes an actual empty ReturnValue. Root cause: the fixture value matched the textual MDL expression for empty instead of the zero-length BSON field value used by void EndEvents. Fix: set ReturnValue to the empty string and assert that the serialized BSON keeps the ReturnValue field as an empty string. Tests: ran make build, targeted sdk/mpr EndEvent tests, make test, and make lint-go. --- sdk/mpr/writer_microflow_version_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/mpr/writer_microflow_version_test.go b/sdk/mpr/writer_microflow_version_test.go index fd3c298a..356927fc 100644 --- a/sdk/mpr/writer_microflow_version_test.go +++ b/sdk/mpr/writer_microflow_version_test.go @@ -86,12 +86,12 @@ func TestSerializeEndEvent_EmptyReturnValueHasNoTrailingLineBreak(t *testing.T) Position: model.Point{X: 10, Y: 20}, Size: model.Size{Width: 20, Height: 20}, }, - ReturnValue: "empty", + ReturnValue: "", } doc := serializeMicroflowObject(end) - if got := bsonGetKey(doc, "ReturnValue"); got != "empty" { - t.Fatalf("ReturnValue = %q, want %q", got, "empty") + if got := bsonGetKey(doc, "ReturnValue"); got != "" { + t.Fatalf("ReturnValue = %q, want empty string", got) } }