Skip to content

Commit 2991c12

Browse files
committed
Merge branch 'issues'
2 parents a5af42d + 59b700f commit 2991c12

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

mdl/executor/cmd_workflows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ func describeWorkflowToString(ctx *ExecContext, name ast.QualifiedName) (string,
185185
}
186186
lines = append(lines, "")
187187

188-
lines = append(lines, fmt.Sprintf("workflow %s", qualifiedName))
188+
lines = append(lines, fmt.Sprintf("create workflow %s", qualifiedName))
189189

190190
// Context parameter
191191
if targetWf.Parameter != nil && targetWf.Parameter.EntityRef != "" {

mdl/executor/cmd_workflows_mock_test.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77

88
"github.com/mendixlabs/mxcli/mdl/ast"
99
"github.com/mendixlabs/mxcli/mdl/backend/mock"
10+
"github.com/mendixlabs/mxcli/mdl/visitor"
1011
"github.com/mendixlabs/mxcli/sdk/workflows"
1112
)
1213

@@ -47,8 +48,14 @@ func TestDescribeWorkflow_Mock(t *testing.T) {
4748
assertNoError(t, describeWorkflow(ctx, ast.QualifiedName{Module: "Sales", Name: "ApproveOrder"}))
4849

4950
out := buf.String()
50-
assertContainsStr(t, out, "workflow")
51+
assertContainsStr(t, out, "create workflow")
5152
assertContainsStr(t, out, "Sales.ApproveOrder")
53+
54+
// Roundtrip: DESCRIBE output must be parseable as valid MDL (issue #478)
55+
_, parseErrs := visitor.Build(out)
56+
if len(parseErrs) > 0 {
57+
t.Errorf("describe workflow output is not valid MDL: %v\nOutput:\n%s", parseErrs[0], out)
58+
}
5259
}
5360

5461
func TestDescribeWorkflow_NotFound(t *testing.T) {

0 commit comments

Comments
 (0)