-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(scenarios): Fix the regex that locates variables to override (#202)
This PR updates the regex used to find exported variables in a scenario that have more complex declarations (I.E. variables that get values from sub-shells, variables that are defined on the same line as another, etc). This PR fixes #199 and tests have been added to ensure that this issue doesn't arise again.
- Loading branch information
Showing
3 changed files
with
139 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Variable declaration and usage | ||
|
||
## Simple declaration | ||
|
||
```bash | ||
export MY_VAR="Hello, World!" | ||
echo $MY_VAR | ||
``` | ||
|
||
## Double variable declaration | ||
|
||
```bash | ||
export NEXT_VAR="Hello" && export OTHER_VAR="Hello, World!" | ||
echo $NEXT_VAR | ||
``` | ||
|
||
## Double declaration with semicolon | ||
|
||
```bash | ||
export THIS_VAR="Hello"; export THAT_VAR="Hello, World!" | ||
echo $OTHER_VAR | ||
``` | ||
|
||
## Declaration with subshell value | ||
|
||
```bash | ||
export SUBSHELL_VARIABLE=$(echo "Hello, World!") | ||
echo $SUBSHELL_VARIABLE | ||
``` | ||
|
||
## Declaration with other variable in value | ||
|
||
```bash | ||
export VAR1="Hello" | ||
export VAR2="$VAR1, World!" | ||
echo $VAR2 | ||
``` |