-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a723b9b
commit 3a2e398
Showing
16 changed files
with
259 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
{ | ||
"experimentalFeaturesEnabled": { | ||
"optionalModuleNames": true, | ||
"userDefinedFunctions": true | ||
"optionalModuleNames": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/PSRule.Rules.Azure.Tests/Bicep/SymbolicNameTestCases/Tests.Bicep.1.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
// Test case for https://github.com/Azure/PSRule.Rules.Azure/issues/2922 | ||
|
||
module child_loop './Tests.Bicep.1.child.bicep' = [ | ||
for (item, index) in range(0, 2): { | ||
name: 'deploy-${index}' | ||
params: { | ||
index: index | ||
} | ||
} | ||
] | ||
|
||
output items array = map(child_loop, item => item.outputs.childValue) | ||
output itemsAsString string[] = map(child_loop, item => item.outputs.childValue) |
6 changes: 6 additions & 0 deletions
6
tests/PSRule.Rules.Azure.Tests/Bicep/SymbolicNameTestCases/Tests.Bicep.1.child.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Copyright (c) Microsoft Corporation. | ||
// Licensed under the MIT License. | ||
|
||
param index int | ||
|
||
output childValue string = 'child-${index}' |
71 changes: 71 additions & 0 deletions
71
tests/PSRule.Rules.Azure.Tests/Bicep/SymbolicNameTestCases/Tests.Bicep.1.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
{ | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"languageVersion": "2.0", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.28.1.47646", | ||
"templateHash": "1381069533852459453" | ||
} | ||
}, | ||
"resources": { | ||
"child_loop": { | ||
"copy": { | ||
"name": "child_loop", | ||
"count": "[length(range(0, 2))]" | ||
}, | ||
"type": "Microsoft.Resources/deployments", | ||
"apiVersion": "2022-09-01", | ||
"name": "[format('deploy-{0}', copyIndex())]", | ||
"properties": { | ||
"expressionEvaluationOptions": { | ||
"scope": "inner" | ||
}, | ||
"mode": "Incremental", | ||
"parameters": { | ||
"index": { | ||
"value": "[copyIndex()]" | ||
} | ||
}, | ||
"template": { | ||
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | ||
"languageVersion": "2.0", | ||
"contentVersion": "1.0.0.0", | ||
"metadata": { | ||
"_generator": { | ||
"name": "bicep", | ||
"version": "0.28.1.47646", | ||
"templateHash": "15231390219392886169" | ||
} | ||
}, | ||
"parameters": { | ||
"index": { | ||
"type": "int" | ||
} | ||
}, | ||
"resources": {}, | ||
"outputs": { | ||
"childValue": { | ||
"type": "string", | ||
"value": "[format('child-{0}', parameters('index'))]" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"outputs": { | ||
"items": { | ||
"type": "array", | ||
"value": "[map(references('child_loop'), lambda('item', lambdaVariables('item').outputs.childValue.value))]" | ||
}, | ||
"itemsAsString": { | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
}, | ||
"value": "[map(references('child_loop'), lambda('item', lambdaVariables('item').outputs.childValue.value))]" | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
tests/PSRule.Rules.Azure.Tests/Bicep/SymbolicNameTestCases/bicepconfig.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"experimentalFeaturesEnabled": { | ||
"optionalModuleNames": true, | ||
"symbolicNameCodegen": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.