-
Notifications
You must be signed in to change notification settings - Fork 730
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cqthyy/params integration unit tests #7352
Merged
cqthyy
merged 17 commits into
Bicep-params-file
from
cqthyy/params-integration-unit-tests
Jun 30, 2022
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
1350c40
Bicep parameter file array & object unit tests
55ff8c2
created bicepparam sample file for integration test, unit test fixes
6ae969e
add integration tests first iteration
cqthyy 0eb20c0
comment cleanup
cqthyy 40c89a7
Bicep param file integration test fixes
cqthyy 39db855
changed SyntaxCollectorVisitor to public helper class, added more tes…
cqthyy dc8dca1
error message fix
cqthyy 2f0c06b
one more error message fix
cqthyy be64d71
Merge branch 'Bicep-params-file' into cqthyy/params-integration-unit-…
cqthyy df0d8c2
merge conflicts
cqthyy 357666a
Merge branch 'cqthyy/params-integration-unit-tests' of https://github…
cqthyy f10b339
semantic token test fixes
cqthyy 266a20e
integration test baseline update
cqthyy e7d299e
additional integration test baseline update
cqthyy 339e35a
additional integration test baseline update
cqthyy 60bd6a8
additional integration test baseline update
cqthyy 96d83d2
additional integration test baseline update
cqthyy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
created bicepparam sample file for integration test, unit test fixes
- Loading branch information
There are no files selected for viewing
58 changes: 58 additions & 0 deletions
58
src/Bicep.Core.Samples/Files/Parameters_LF/main.bicepparam
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,58 @@ | ||
/* | ||
This is a | ||
multiline comment! | ||
*/ | ||
|
||
// This is a single line comment | ||
|
||
// using keyword for specifying a Bicep file | ||
using './main.bicep/' | ||
|
||
// parameter assignment to literals | ||
param myInt = 42 | ||
param myStr = "hello world!" | ||
param myBool = true | ||
|
||
// parameter assignment to objects | ||
param myObj = { | ||
name: 'vm1' | ||
location: 'westus' | ||
} | ||
param myComplexObj = { | ||
enabled: true | ||
name: 'complex object!' | ||
priority: 3 | ||
data: { | ||
a: 'b' | ||
c: [ | ||
'd' | ||
'e' | ||
] | ||
} | ||
} | ||
|
||
// parameter assignment to arrays | ||
param myIntArr = [ | ||
1 | ||
2 | ||
3 | ||
4 | ||
5 | ||
] | ||
param myStrArr = [ | ||
'ant' | ||
'bear' | ||
'cat' | ||
'dog' | ||
] | ||
param myComplexArr = [ | ||
'eagle' | ||
21 | ||
false | ||
{ | ||
f: [ | ||
'g' | ||
'h' | ||
] | ||
} | ||
] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since the we allow non-literal values at syntax level, we can add some test cases to ensure they can also be parsed, for example:
They can also be useful for validating semantic diagnostics later, since we are going to implement semantic checking to block non-literal values. |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Git by default will convert line endings depending on whether you're checking out code on Windows (
\r\n
) or Unix/Linux (\n
). This causes problems for the baseline tests - to fix this, you may need to copy the config we added for.bicep
to your new extension - to respect the newline format of the file and avoid converting on different platforms:bicep/.gitattributes
Lines 1 to 2 in 6d0eeaf