-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix Correct if syntax #167
Conversation
The test script `if_else.sh` has incorrect syntax for an if statement: $ bash if_else.sh if_else.sh: line 2: syntax error near unexpected token `then' if_else.sh: line 2: `if [[ $FOO -eq 1 ]] then' The correct syntax uses `;` before `then`.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #167 +/- ##
==========================================
+ Coverage 58.05% 61.46% +3.40%
==========================================
Files 29 29
Lines 2818 2818
==========================================
+ Hits 1636 1732 +96
+ Misses 1182 1086 -96
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Let's test all of the combinations: FOO=2
if [[ $FOO -eq 1 ]]; then
echo "FOO is 1";
elif [[ $FOO -eq 2 ]]; then
echo "FOO is 2";
else
echo "FOO is not 1 or 2";
fi and FOO=2
if [[ $FOO -eq 1 ]]; then
echo "FOO is 1"
elif [[ $FOO -eq 2 ]]; then
echo "FOO is 2"
else
echo "FOO is not 1 or 2"
fi and FOO=2
if [[ $FOO -eq 1 ]];
then
echo "FOO is 1";
elif [[ $FOO -eq 2 ]];
then
echo "FOO is 2";
else
echo "FOO is not 1 or 2";
fi and FOO=2
if [[ $FOO -eq 1 ]]
then
echo "FOO is 1";
elif [[ $FOO -eq 2 ]]
then
echo "FOO is 2";
else
echo "FOO is not 1 or 2";
fi |
I'll just create a way for the scripts in script folder to be tested. That would be easier I believe. |
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.
Awesome, I think this looks great now!
Agreed. |
Closes #166