Commit e80859d7 authored by Yeonjae Im's avatar Yeonjae Im Committed by Jens Getreu

better use `if-then-else` then `&& ||` in shell script

* Fix the "01-test" file with shellcheck

Its code has a problem SC2015.
https://github.com/koalaman/shellcheck/wiki/SC2015

* Add the ".idea" file in ".gitignore"

".idea" file is created by IDE made by IntelliJ IDEA

* Removed .idea folder

* Update 01-test
Co-authored-by: Jens Getreu's avatarJens Getreu <getreu@web.de>
parent 559f19d6
Pipeline #111914183 passed with stage
in 2 minutes and 8 seconds
......@@ -6,3 +6,4 @@ target
*.1.gz
.vscode/
tests/functional/output
.idea
\ No newline at end of file
......@@ -2,9 +2,12 @@
# Unit testing
cargo test \
&& echo Cargo test succeeded. \
|| ( echo Cargo test failed. && exit 1 )
if cargo test
then
echo Cargo test succeeded.
else
( echo Cargo test failed. && exit 1 )
fi
# Functional tests
......@@ -17,23 +20,32 @@ cargo build
../../target/debug/stringsext -q 16 -g 63 -tx -a All-Ctrl -u Common \
-e UTF-8 -e utf-16le -e utf-16be input1 > output
diff output expected_output1 \
&& echo Commandline test 1 succeeded. \
|| ( echo Commandline test 1 failed. && exit 2 )
if diff output expected_output1
then
echo Commandline test 1 succeeded.
else
( echo Commandline test 1 failed. && exit 2 )
fi
# We search for `:`.
../../target/debug/stringsext -n 10 -q 32 -g 58 -tx -a All-Ctrl -u Common \
-e UTF-8 -e utf-16le -e utf-16be input1 input2 > output
diff output expected_output2 \
&& echo Commandline test 2 succeeded. \
|| ( echo Commandline test 2 failed. && exit 3 )
if diff output expected_output2
then
echo Commandline test 2 succeeded.
else
( echo Commandline test 2 failed. && exit 3 )
fi
# We search for nothing. Do we get nothing?
../../target/debug/stringsext -q 32 -tx -a None -u None \
-e UTF-8 -e utf-16le -e utf-16be input1 input2 > output
diff output expected_output3 \
&& echo Commandline test 3 succeeded. \
|| ( echo Commandline test 3 failed. && exit 4 )
if diff output expected_output3
then
echo Commandline test 3 succeeded.
else
( echo Commandline test 3 failed. && exit 4 )
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment