Skip to content

Commit 4f92da2

Browse files
author
engalar
committed
test: add doctype-test for @Module.Const in microflow expressions
Adds regression coverage for the parse→check roundtrip of constant references using @Module.Const syntax in microflow DECLARE statements and compound expressions. Addresses review feedback on PR #179.
1 parent 2a6ad31 commit 4f92da2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

mdl-examples/doctype-tests/09-constant-examples.mdl

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,34 @@ DEFAULT true;
150150
DROP CONSTANT CoTest.LaunchDate;
151151
/
152152

153+
-- MARK: - Constants in Microflow Expressions (regression: issue #178)
154+
155+
/**
156+
* Level 5.1: Use @Module.Const in a microflow DECLARE
157+
* Tests that `@Module.Const` syntax parses and round-trips correctly.
158+
* Regression test for: DESCRIBE → re-parse roundtrip with @-style constant refs.
159+
*/
160+
CREATE OR REPLACE MICROFLOW CoTest.UseConstantRef ()
161+
RETURNS Nothing
162+
BEGIN
163+
DECLARE $Endpoint String = @CoTest.ServiceEndpoint;
164+
DECLARE $Retries Integer = @CoTest.MaxRetries;
165+
DECLARE $IsTaxable Boolean = @CoTest.EnableDebugLogging;
166+
END;
167+
/
168+
169+
/**
170+
* Level 5.2: Mix @Module.Const with other expressions
171+
* Confirms constant references work in compound expressions alongside literals.
172+
*/
173+
CREATE OR REPLACE MICROFLOW CoTest.MixedConstantExpressions ()
174+
RETURNS Nothing
175+
BEGIN
176+
DECLARE $Limit Decimal = @CoTest.TaxRate + 0.05;
177+
DECLARE $Msg String = 'Endpoint: ' + @CoTest.ServiceEndpoint;
178+
END;
179+
/
180+
153181
-- ############################################################################
154182
-- END OF CONSTANT EXAMPLES
155183
-- ############################################################################

0 commit comments

Comments
 (0)