Skip to content

Commit

Permalink
Merge pull request #62 from Dirack/feature/issue/48
Browse files Browse the repository at this point in the history
Update changes from develop/1.3
  • Loading branch information
Dirack committed Apr 28, 2020
2 parents 9d98be8 + 9b52a5a commit 4f82017
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions TDD/lipsum_tdd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,18 @@ source $(dirname $0)/tdd_lib.sh
# Testar se lipsum exibe a quantidade de linhas pedidas corretamente
error "$(lipsum -r | wc -l)" "1" "1" "Exibir uma linha com lipsum -r"
error "$(lipsum -r 10 | wc -l)" "10" "2" "Exibir 10 linhas com lipsum -r 10"

# Testar condição limite
total="1000"
for i in $(seq $total)
do
echo -ne "\tRodando lipsum repetidamente ($i/$total)\r\r"
LINHAS=$(lipsum -r | wc -l)
if [ "$LINHAS" -ne "1" ]
then
echo " "
error "$LINHAS" "1" "3" "Exibir uma linha com lipsum -r"
fi
done

error "$LINHAS" "1" "3" "Rodando lipsum repetidamente ($total/$total)"
2 changes: 1 addition & 1 deletion lipsum
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ case "$1" in

for i in $(seq "$NUM_LINHAS")
do
LINHA=$(echo "$RANDOM % $TOTAL_LINHAS" | bc )
LINHA=$(echo "$RANDOM % $TOTAL_LINHAS + 1" | bc )
sed -n "${LINHA}p" "$CONFIG"
done
;;
Expand Down

0 comments on commit 4f82017

Please sign in to comment.