diff options
author | chriseth <c@ethdev.com> | 2017-03-11 02:10:47 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2017-03-11 02:22:28 +0800 |
commit | 864bfafbcd77846b688ece3edb945a285b74c747 (patch) | |
tree | f741e7a53998f8a1cc2a4d894ca8f54be0bf81f9 /test | |
parent | f1dd79c7433a6c78e879a0b597b0585921838f1e (diff) | |
download | dexon-solidity-864bfafbcd77846b688ece3edb945a285b74c747.tar.gz dexon-solidity-864bfafbcd77846b688ece3edb945a285b74c747.tar.zst dexon-solidity-864bfafbcd77846b688ece3edb945a285b74c747.zip |
Test for (not) overwriting files.
Diffstat (limited to 'test')
-rwxr-xr-x | test/cmdlineTests.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/cmdlineTests.sh b/test/cmdlineTests.sh index cb714efe..fc04bd7d 100755 --- a/test/cmdlineTests.sh +++ b/test/cmdlineTests.sh @@ -50,9 +50,23 @@ echo "Testing library checksum..." echo '' | "$SOLC" --link --libraries a:0x90f20564390eAe531E810af625A22f51385Cd222 ! echo '' | "$SOLC" --link --libraries a:0x80f20564390eAe531E810af625A22f51385Cd222 2>/dev/null +echo "Testing overwriting files" +TMPDIR=$(mktemp -d) +( + set -e + # First time it works + echo 'contract C {} ' | "$SOLC" --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null + # Second time it fails + ! echo 'contract C {} ' | "$SOLC" --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null + # Unless we force + echo 'contract C {} ' | "$SOLC" --overwrite --bin -o "$TMPDIR/non-existing-stuff-to-create" 2>/dev/null +) +rm -rf "$TMPDIR" + echo "Testing soljson via the fuzzer..." TMPDIR=$(mktemp -d) ( + set -e cd "$REPO_ROOT" REPO_ROOT=$(pwd) # make it absolute cd "$TMPDIR" |