t3419: drop unnecessary NOT_EXPENSIVE pseudo-prerequisite
This was only necessary because do_tests helper the script defines took its parameters in a wrong order. Just pass an empty string (or not passing the optional EXPENSIVE prerequisite) when running the test with a light-weight set of parameters and have the shell do the right thing when parsing test_expect_success helper. Also update coding style while we are at it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Jun 9, 2014 at 14:03 UTC
b687cd6aba394bba34ad9fb70aa33cd5cfcebc6c
1 file changed
+8
-14
t/t3419-rebase-patch-id.sh
+8
-14
@@ -4,11 +4,9 @@ test_description='git rebase - test patch id computation'
4
5
. ./test-lib.sh
6
7
-test_set_prereq NOT_EXPENSIVE
7
test -n "$GIT_PATCHID_TIMING_TESTS" && test_set_prereq EXPENSIVE
8
10
-count()
11
-{
9
+count () {
10
i=0
11
while test $i -lt $1
12
do
@@ -17,8 +15,7 @@ count()
15
done
16
}
17
20
-scramble()
21
-{
18
+scramble () {
19
i=0
20
while read x
21
do
@@ -27,12 +24,11 @@ scramble()
24
echo "$x"
25
fi
26
i=$((($i+1) % 10))
30
- done < "$1" > "$1.new"
27
+ done <"$1" >"$1.new"
28
mv -f "$1.new" "$1"
29
}
30
34
-run()
35
-{
31
+run () {
32
echo \$ "$@"
33
/usr/bin/time "$@" >/dev/null
34
}
@@ -42,10 +38,8 @@ test_expect_success 'setup' '
38
git tag root
39
'
40
45
-do_tests()
46
-{
47
- pr=$1
48
- nlines=$2
41
+do_tests () {
42
+ nlines=$1 pr=${2-}
43
44
test_expect_success $pr "setup: $nlines lines" "
45
rm -f .gitattributes &&
@@ -102,7 +96,7 @@ do_tests()
96
"
97
}
98
105
-do_tests NOT_EXPENSIVE 500
106
-do_tests EXPENSIVE 50000
99
+do_tests 500
100
+do_tests 50000 EXPENSIVE
101
102
test_done