-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff79363
commit aa7a7ad
Showing
10 changed files
with
283 additions
and
152 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
|
||
dir='' | ||
|
||
for arg in "$@"; do | ||
case $arg in | ||
--dir) | ||
dir=$2 | ||
shift # Remove argument --dir from `$@` | ||
shift # Remove argument value from `$@` | ||
;; | ||
esac | ||
done | ||
|
||
echo " | ||
Asserting '$dir' exists and that it is empty" | ||
|
||
if [ -d "$dir" ]; then | ||
echo "The target directory exists, which is expected." | ||
else | ||
echo "The target directory does not exist but it should." | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$(ls -A $dir)" ]; then | ||
echo "The target directory is empty, which is expected." | ||
else | ||
echo "The target directory is not empty but it should be." | ||
echo "These items exist under the directory:" | ||
ls -r $dir | ||
exit 1 | ||
fi |
This file was deleted.
Oops, something went wrong.
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,45 @@ | ||
#!/bin/bash | ||
|
||
substringFile='' | ||
fullFile='' | ||
|
||
for arg in "$@"; do | ||
case $arg in | ||
--substringFile) | ||
substringFile=$2 | ||
shift # Remove argument --substringFile from `$@` | ||
shift # Remove argument value from `$@` | ||
;; | ||
--fullFile) | ||
fullFile=$2 | ||
shift # Remove argument --fullFile from `$@` | ||
shift # Remove argument value from `$@` | ||
;; | ||
|
||
esac | ||
done | ||
|
||
# Print out the file contents for easy manual comparison | ||
echo " | ||
Asserting full file contains substring: | ||
File with full contents: '$fullFile' | ||
File with substring: '$substringFile'" | ||
|
||
fullFileContents=$(cat $fullFile) | ||
echo "::group::Full file contents" | ||
echo "'$fullFileContents'" | ||
echo "::endgroup::" | ||
|
||
substringContents=$(cat $substringFile) | ||
echo "::group::Substring" | ||
echo "'$substringContents'" | ||
echo "::endgroup::" | ||
|
||
|
||
# Now compare the contents | ||
if echo "$fullFileContents" | grep -q "$substringContents"; then | ||
echo "The file contains the substring, which is expected." | ||
else | ||
echo "The file does not contain the substring, which is not expected." | ||
exit 1 | ||
fi |
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 |
---|---|---|
|
@@ -13,4 +13,4 @@ MyProj | |
MyProj.Core 90.9% | ||
MyProj.Core.EnumExtensions 90.9% | ||
|
||
MyProj.Tests.Shared | ||
MyProj.Tests.Shared |
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