-
Notifications
You must be signed in to change notification settings - Fork 144
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
feat(tests): add range
supports
#453
Merged
Merged
Conversation
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
loop
supportsrange
supports
fsamin
requested changes
Nov 29, 2021
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.
Thanks for the PR.
Here are some feedback.
Can you also add a new section in the README ?
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
Signed-off-by: GitHub <noreply@github.com>
|
yesnault
approved these changes
Nov 29, 2021
fsamin
requested changes
Nov 30, 2021
Signed-off-by: GitHub <noreply@github.com>
fsamin
approved these changes
Dec 3, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
May close #263 and close #288
This add support for the
range
attribute that can be passed in a step context.The following types along their contexted variables are supported:
[]interface{}
: an array of values.index
/.key
: current iteration index.value
: current iteration item valuemap[string]interface{}
: a map of values (each key will be iterated over).index
: current iteration index.key
: current iteration item key.value
: current iteration item valueint
: an integer to perform actionn
times.index
/.key
/.value
: current iteration indexstring
: a templated string which results in one of the above typingWithin a range context,
.range
variable will be set totrue
(while it'll befalse
in "regular" contexts)Here's an example (see
tests/ranged.yml
in this PR diff for more examples):Image below show the content of
![image](https://user-images.githubusercontent.com/22963968/143625676-514271e2-5c84-4796-af74-5a713307b130.png)
Range struct
for each test case:I haven't run
go fmt
yet as it'll enclose the current step processing (L176 to L281) within thefor
which make the diff harder to review. If no further changes are requested, I'll run the formatter and add some documentation in theREADME.md
with definitive syntax 🙂