-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add error functions in tests scripts and print test names
- Loading branch information
1 parent
6817465
commit 3d41ff6
Showing
3 changed files
with
19 additions
and
11 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
#! /usr/bin/env sh | ||
|
||
# import helpers functions | ||
. ../../helpers.sh | ||
|
||
echo "Running tests: $(basename "$(pwd)")" | ||
|
||
# replace the hardhat version in the files used to check that the output is correct because it changes in every release | ||
sed -i "s/hardhat v[0-9]*\.[0-9]*\.[0-9]*/hardhat v$1/g" "flatten_all_files.txt" | ||
sed -i "s/hardhat v[0-9]*\.[0-9]*\.[0-9]*/hardhat v$1/g" "flatten_lock_file.txt" | ||
|
||
# it should flatten all the files in the folder because no file names are passed | ||
if ! npx hardhat flatten | diff - flatten_all_files.txt; then | ||
echo "The flatten file is different from the flatten_all_files.txt" | ||
exit 1 | ||
echo "it should flatten all the files in the folder because no file names are passed" | ||
if ! npx hardhat flatten 2>stderr | diff - flatten_all_files.txt; then | ||
print_error_msg "The flatten file is different from the flatten_all_files.txt" | ||
exit 1 | ||
fi | ||
|
||
# it should flatten only the 'Lock.sol' file because it is passed as an argument | ||
if ! npx hardhat flatten contracts/Lock.sol | diff - flatten_lock_file.txt; then | ||
echo "The flatten file is different from the flatten_lock_file.txt" | ||
exit 1 | ||
echo "it should flatten only the 'Lock.sol' file because it is passed as an argument" | ||
if ! npx hardhat flatten contracts/Lock.sol 2>stderr | diff - flatten_lock_file.txt; then | ||
print_error_msg "The flatten file is different from the flatten_lock_file.txt" | ||
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