0c51d6b4ae
Failures within `for` and `while` loops can go unnoticed if not detected and signaled manually since the loop itself does not abort when a contained command fails, nor will a failure necessarily be detected when the loop finishes since the loop returns the exit code of the last command it ran on the final iteration, which may not be the command which failed. Therefore, detect and signal failures manually within loops using the idiom `|| return 1` (or `|| exit 1` within subshells). Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
24 lines
485 B
Bash
Executable File
24 lines
485 B
Bash
Executable File
#!/bin/sh
|
|
|
|
test_description='Test the Git Mediawiki remote helper: queries w/ more than 500 results'
|
|
|
|
. ./test-gitmw-lib.sh
|
|
. $TEST_DIRECTORY/test-lib.sh
|
|
|
|
test_check_precond
|
|
|
|
test_expect_success 'creating page w/ >500 revisions' '
|
|
wiki_reset &&
|
|
for i in $(test_seq 501)
|
|
do
|
|
echo "creating revision $i" &&
|
|
wiki_editpage foo "revision $i<br/>" true || return 1
|
|
done
|
|
'
|
|
|
|
test_expect_success 'cloning page w/ >500 revisions' '
|
|
git clone mediawiki::'"$WIKI_URL"' mw_dir
|
|
'
|
|
|
|
test_done
|