Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4bbe06e

Browse files
committedJun 3, 2015
ipfs-test-lib: implement test_seq()
License: MIT Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
1 parent 7fbfecf commit 4bbe06e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
 

‎test/ipfs-test-lib.sh

+13
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,16 @@ test_sort_cmp() {
2222
sort "$2" >"$2_sorted" &&
2323
test_cmp "$1_sorted" "$2_sorted"
2424
}
25+
26+
# Depending on GNU seq availability is not nice.
27+
# Git also has test_seq but it uses Perl.
28+
test_seq() {
29+
test "$1" -le "$2" || return
30+
i="$1"
31+
j="$2"
32+
while test "$i" -le "$j"
33+
do
34+
echo "$i"
35+
i=$(expr "$i" + 1)
36+
done
37+
}

0 commit comments

Comments
 (0)
Please sign in to comment.