Skip to content

Commit bbb4471

Browse files
committed
Add more test cases
1 parent 9c8863d commit bbb4471

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

compiler/tests/verify_consistent_compiler_output.go

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,25 @@ script TestShorthandScriptInvocationAsElseIfCondition {
302302
}
303303
}
304304
305+
script TestShortHandScriptInvocationWithParametersAsCondition {
306+
// Experimental syntax
307+
if @(is_cardinal_direction direction="north") {
308+
printf "north"
309+
}
310+
}
311+
305312
script TestShorthandBooleanReturnTrue {
313+
// Experimental syntax
306314
return true
307315
}
308316
309317
script TestShorthandBooleanReturnFalse {
318+
// Experimental syntax
310319
return false
311320
}
312321
313-
script TestShorthandBooleanReturnMultipleArguments {
322+
script TestShorthandBooleanReturnWithMultipleArguments {
323+
// Experimental syntax
314324
return true \
315325
x = 10 \
316326
y = 20 \
@@ -487,6 +497,12 @@ const expectedDecompiledRoq = `
487497
:i endif
488498
:i endif
489499
:i endfunction
500+
:i function $TestShortHandScriptInvocationWithParametersAsCondition$
501+
:i ($is_cardinal_direction$$direction$ = %s(5,"north"))
502+
:i if (%GLOBAL%$__boolean_result__$ = %i(1,00000001))
503+
:i $printf$%s(5,"north")
504+
:i endif
505+
:i endfunction
490506
:i function $TestShorthandBooleanReturnTrue$
491507
:i return
492508
$__boolean_result__$ = %i(1,00000001)
@@ -495,7 +511,7 @@ const expectedDecompiledRoq = `
495511
:i return
496512
$__boolean_result__$ = %i(0,00000000)
497513
:i endfunction
498-
:i function $TestShorthandBooleanReturnMultipleArguments$
514+
:i function $TestShorthandBooleanReturnWithMultipleArguments$
499515
:i return
500516
$__boolean_result__$ = %i(1,00000001)$x$ = %i(10,0000000a)$y$ = %i(20,00000014)$z$ = %i(30,0000001e)
501517
:i endfunction

0 commit comments

Comments
 (0)