Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump dependencies, bugfixes, expand the descriptions a bit #77

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/usr/bin/env bash


for app in examples/* ; do
if [ $app != "examples/null-app" ] ; then
OUT=$(cargo run -q --bin "$( basename "$app" )" -- --number 10 --no-such-flag 2> /dev/null)
if [ $? -eq 0 ]
then
echo "Check if parser accepts unexpected flags"
echo "$app produced\n$OUT"
fi
fi
done

for app in examples/* ; do
if [ $app != "examples/null-app" ] ; then
OUT=$( cargo run -q --bin "$( basename "$app" )" -- --number=10 2>&1 )
if [ $? -ne 0 ]
then
echo "Check if --arg=val is accepted"
echo "$app produced\n$OUT"
fi
fi
done

for app in examples/* ; do
if [ $app != "examples/null-app" ] ; then
OUT=$( cargo run -q --bin "$( basename "$app" )" -- -hh 2>&1 )
if [ $? -ne 0 ]
then
echo "Check if -hh is accepted"
echo "$app produced\n$OUT"
fi
fi
done

for app in examples/* ; do
if [ $app != "examples/null-app" ] ; then
OUT=$( cargo run -q --bin "$( basename "$app" )" -- --number 9000 --number 9001 2>&1 )
if [ $? -eq 0 ]
then
echo "Check if duplicate flags are accepted"
echo "$app produced\n$OUT"
fi
fi
done



for app in examples/* ; do
if [ $app != "examples/null-app" ] ; then
OUT=$( cargo run -q --bin "$( basename "$app" )" -- --number 9000000000000000000000 2>&1 )
if [ $? -eq 0 ]
then
echo "Try to feed invalid numbers"
echo "$app produced\n$OUT"
fi
fi
done