Skip to content

Commit

Permalink
add tests for updated regular expression
Browse files Browse the repository at this point in the history
  • Loading branch information
Logout22 committed Jun 15, 2020
1 parent a0d1ed1 commit c413d7c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion test-hook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ checkname ()

filename="$1"
counter=$(expr $counter \+ 1)
mkdir -p "$(dirname "$filename")" &&
touch "$filename" &&
git add "$filename" &&
GIT_TRACE=1 git commit -m "my message"
ret=$?
git reset --hard $commit > /dev/null

if test $ret -eq 1
expected_exit_code=${2:-1}
if test $ret -eq $expected_exit_code
then
echo "Test $counter passed"
else
Expand All @@ -50,6 +52,10 @@ echo "###reserved names###"
checkname "CON.txt"
checkname "AUX.txt"
checkname "LPT1.txt"
checkname "COM1"
checkname "NUL"
checkname "sub/folder/PRN"
checkname "comic-con.txt" 0

echo "###no trailing period or space###"
checkname " "
Expand Down

0 comments on commit c413d7c

Please sign in to comment.