"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Omar Polo <op@omarpolo.com>
Subject:
use seq instead of jot in regress
To:
gameoftrees@openbsd.org
Date:
Tue, 09 Apr 2024 09:07:39 +0200

Download raw body.

Thread
This is just for -portable, since jot is not always available.  seq is
available on OpenBSD since 7.1, so it should be fine.

regress still passes, except for the current failure in gotd regress,
but that's for another reason.

ok?

diff /home/op/w/got
commit - 124eeb84c84b5d49a94e0210e4add23c6da93b47
path + /home/op/w/got
blob - 58bd8cfd19c7fe4497faed3ae1bc31b8c288fc98
file + regress/cmdline/blame.sh
--- regress/cmdline/blame.sh
+++ regress/cmdline/blame.sh
@@ -205,7 +205,7 @@ test_blame_all_lines_replaced() {
 		return 1
 	fi
 
-	jot 8 > $testroot/wt/alpha
+	seq 8 > $testroot/wt/alpha
 	(cd $testroot/wt && got commit -m "change 1" > /dev/null)
 	local commit1=`git_show_head $testroot/repo`
 	local short_commit1=`trim_obj_id 32 $commit1`
@@ -242,7 +242,7 @@ test_blame_lines_shifted_up() {
 		return 1
 	fi
 
-	jot 8 > $testroot/wt/alpha
+	seq 8 > $testroot/wt/alpha
 	(cd $testroot/wt && got commit -m "change 1" > /dev/null)
 	local commit1=`git_show_head $testroot/repo`
 	local short_commit1=`trim_obj_id 32 $commit1`
@@ -256,11 +256,11 @@ test_blame_lines_shifted_up() {
 	local commit2=`git_show_head $testroot/repo`
 	local short_commit2=`trim_obj_id 32 $commit2`
 
-	jot 2 > $testroot/wt/alpha
+	seq 2 > $testroot/wt/alpha
 	echo foo >> $testroot/wt/alpha
 	echo bar >> $testroot/wt/alpha
 	echo baz >> $testroot/wt/alpha
-	jot 8 6 8 1 >> $testroot/wt/alpha
+	seq 6 8 >> $testroot/wt/alpha
 	(cd $testroot/wt && got commit -m "change 3" > /dev/null)
 	local commit3=`git_show_head $testroot/repo`
 	local short_commit3=`trim_obj_id 32 $commit3`
@@ -301,7 +301,7 @@ test_blame_lines_shifted_down() {
 		return 1
 	fi
 
-	jot 8 > $testroot/wt/alpha
+	seq 8 > $testroot/wt/alpha
 	(cd $testroot/wt && got commit -m "change 1" > /dev/null)
 	local commit1=`git_show_head $testroot/repo`
 	local short_commit1=`trim_obj_id 32 $commit1`
@@ -315,11 +315,11 @@ test_blame_lines_shifted_down() {
 	local commit2=`git_show_head $testroot/repo`
 	local short_commit2=`trim_obj_id 32 $commit2`
 
-	jot 2 > $testroot/wt/alpha
+	seq 2 > $testroot/wt/alpha
 	echo foo >> $testroot/wt/alpha
 	echo bar >> $testroot/wt/alpha
 	echo baz >> $testroot/wt/alpha
-	jot 8 3 8 1 >> $testroot/wt/alpha
+	seq 3 8 >> $testroot/wt/alpha
 	(cd $testroot/wt && got commit -m "change 3" > /dev/null)
 	local commit3=`git_show_head $testroot/repo`
 	local short_commit3=`trim_obj_id 32 $commit3`
blob - 0e7cf31f819a9e93d3c0add3720b63ae6d10314b
file + regress/cmdline/cleanup.sh
--- regress/cmdline/cleanup.sh
+++ regress/cmdline/cleanup.sh
@@ -256,7 +256,7 @@ test_cleanup_redundant_pack_files() {
 	touch "${kpack%.pack}.keep"
 
 	# create a few pack files with different objects
-	for i in `jot 5`; do
+	for i in `seq 5`; do
 		echo "alpha $i" > $testroot/repo/alpha
 		git_commit "$testroot/repo" -m "edit #$i"
 		gotadmin pack -r "$testroot/repo" >/dev/null
@@ -295,7 +295,7 @@ test_cleanup_redundant_pack_files() {
 	fi
 
 	# create one more non-redundant pack
-	for i in `jot 5`; do
+	for i in `seq 5`; do
 		echo "alpha again $i" > $testroot/repo/alpha
 		git_commit "$testroot/repo" -m "edit $i"
 	done
@@ -316,7 +316,7 @@ test_cleanup_redundant_pack_files() {
 	# create some commits on a separate branch
 	git -C "$testroot/repo" checkout -q -b newbranch
 
-	for i in `jot 5`; do
+	for i in `seq 5`; do
 		echo "alpha $i" > $testroot/repo/alpha
 		git_commit "$testroot/repo" -m "edit #$i"
 		gotadmin pack -r "$testroot/repo" >/dev/null
blob - d4500f1b7676ed3946c82efc8e8d7f50755569bc
file + regress/cmdline/patch.sh
--- regress/cmdline/patch.sh
+++ regress/cmdline/patch.sh
@@ -26,7 +26,7 @@ test_patch_basic() {
 		return 1
 	fi
 
-	jot 100 > $testroot/wt/numbers
+	seq 100 > $testroot/wt/numbers
 	(cd $testroot/wt && got add numbers && got commit -m +numbers) \
 		>/dev/null
 	ret=$?
@@ -132,7 +132,7 @@ EOF
 		return 1
 	fi
 
-	jot 5 > $testroot/wt/eta.expected
+	seq 5 > $testroot/wt/eta.expected
 	cmp -s $testroot/wt/eta.expected $testroot/wt/eta
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -141,7 +141,7 @@ EOF
 		return 1
 	fi
 
-	jot 103 | sed -e 's/^6$/six/' -e 's/60/sixty/' \
+	seq 103 | sed -e 's/^6$/six/' -e 's/60/sixty/' \
 		> $testroot/wt/numbers.expected
 	cmp -s $testroot/wt/numbers.expected $testroot/wt/numbers
 	ret=$?
@@ -161,7 +161,7 @@ test_patch_dont_apply() {
 		return 1
 	fi
 
-	jot 100 > $testroot/wt/numbers
+	seq 100 > $testroot/wt/numbers
 	(cd $testroot/wt && got add numbers && got commit -m 'add numbers') \
 		>/dev/null
 	ret=$?
@@ -774,10 +774,10 @@ test_patch_with_offset() {
  93
 EOF
 
-	jot 100 > $testroot/wt/numbers
+	seq 100 > $testroot/wt/numbers
 	ed -s "$testroot/wt/numbers" <<EOF
 1,10d
-50r !jot 20
+50r !seq 20
 w
 q
 EOF
@@ -1298,7 +1298,7 @@ test_patch_merge_simple() {
 		return 1
 	fi
 
-	jot 10 > $testroot/wt/numbers
+	seq 10 > $testroot/wt/numbers
 	chmod +x $testroot/wt/numbers
 	(cd $testroot/wt && got add numbers && got commit -m +numbers) \
 		> /dev/null
@@ -1308,7 +1308,7 @@ test_patch_merge_simple() {
 		return 1
 	fi
 
-	jot 10 | sed 's/4/four/g' > $testroot/wt/numbers
+	seq 10 | sed 's/4/four/g' > $testroot/wt/numbers
 
 	(cd $testroot/wt && got diff > $testroot/old.diff \
 		&& got revert numbers) >/dev/null
@@ -1318,7 +1318,7 @@ test_patch_merge_simple() {
 		return 1
 	fi
 
-	jot 10 | sed 's/6/six/g' > $testroot/wt/numbers
+	seq 10 | sed 's/6/six/g' > $testroot/wt/numbers
 	(cd $testroot/wt && got commit -m 'edit numbers') \
 		> /dev/null
 	ret=$?
@@ -1344,7 +1344,7 @@ test_patch_merge_simple() {
 		return 1
 	fi
 
-	jot 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
+	seq 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
 	cmp -s $testroot/wt/numbers $testroot/wt/numbers.expected
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1364,7 +1364,7 @@ test_patch_merge_simple() {
 test_patch_merge_gitdiff() {
 	local testroot=`test_init patch_merge_gitdiff`
 
-	jot 10 > $testroot/repo/numbers
+	seq 10 > $testroot/repo/numbers
 	git -C $testroot/repo add numbers && \
 		git_commit $testroot/repo -m "nums"
 	ret=$?
@@ -1373,7 +1373,7 @@ test_patch_merge_gitdiff() {
 		return 1
 	fi
 
-	jot 10 | sed 's/4/four/g' > $testroot/repo/numbers
+	seq 10 | sed 's/4/four/g' > $testroot/repo/numbers
 	git -C $testroot/repo diff > $testroot/old.diff
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1382,9 +1382,9 @@ test_patch_merge_gitdiff() {
 	fi
 
 	# restore numbers
-	jot 10 > $testroot/repo/numbers
+	seq 10 > $testroot/repo/numbers
 
-	jot 10 | sed 's/6/six/g' > $testroot/repo/numbers
+	seq 10 | sed 's/6/six/g' > $testroot/repo/numbers
 	git -C $testroot/repo add numbers && \
 		git_commit $testroot/repo -m "edit"
 	ret=$?
@@ -1427,7 +1427,7 @@ test_patch_merge_base_provided() {
 		return 1
 	fi
 
-	jot 10 > $testroot/wt/numbers
+	seq 10 > $testroot/wt/numbers
 	(cd $testroot/wt && got add numbers && got commit -m +numbers) \
 		>/dev/null
 	ret=$?
@@ -1438,13 +1438,13 @@ test_patch_merge_base_provided() {
 
 	local commit_id=`git_show_head $testroot/repo`
 
-	jot 10 | sed s/4/four/ > $testroot/wt/numbers
+	seq 10 | sed s/4/four/ > $testroot/wt/numbers
 
 	# get rid of the metadata
 	(cd $testroot/wt && got diff | sed -n '/^---/,$p' > patch) \
 		>/dev/null
 
-	jot 10 | sed s/6/six/ > $testroot/wt/numbers
+	seq 10 | sed s/6/six/ > $testroot/wt/numbers
 	(cd $testroot/wt && got commit -m 'edit numbers') >/dev/null
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1468,7 +1468,7 @@ test_patch_merge_base_provided() {
 		return 1
 	fi
 
-	jot 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
+	seq 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
 	cmp -s $testroot/wt/numbers $testroot/wt/numbers.expected
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1487,7 +1487,7 @@ test_patch_merge_conflict() {
 		return 1
 	fi
 
-	jot 10 > $testroot/wt/numbers
+	seq 10 > $testroot/wt/numbers
 	(cd $testroot/wt && got add numbers && got commit -m +numbers) \
 		> /dev/null
 	ret=$?
@@ -1498,7 +1498,7 @@ test_patch_merge_conflict() {
 
 	local commit_id=`git_show_head $testroot/repo`
 
-	jot 10 | sed 's/6/six/g' > $testroot/wt/numbers
+	seq 10 | sed 's/6/six/g' > $testroot/wt/numbers
 	echo ALPHA > $testroot/wt/alpha
 
 	(cd $testroot/wt && got diff > $testroot/old.diff \
@@ -1509,8 +1509,8 @@ test_patch_merge_conflict() {
 		return 1
 	fi
 
-	jot 10 | sed 's/6/3+3/g' > $testroot/wt/numbers
-	jot -c 3 a > $testroot/wt/alpha
+	seq 10 | sed 's/6/3+3/g' > $testroot/wt/numbers
+	printf '%s\n' a b c > $testroot/wt/alpha
 	(cd $testroot/wt && got commit -m 'edit alpha and numbers') \
 		> /dev/null
 	ret=$?
@@ -1702,7 +1702,7 @@ test_patch_merge_reverse() {
 		return 1
 	fi
 
-	jot 10 > $testroot/wt/numbers
+	seq 10 > $testroot/wt/numbers
 	(cd $testroot/wt && got add numbers && got commit -m +numbers) \
 		> /dev/null
 	ret=$?
@@ -1713,7 +1713,7 @@ test_patch_merge_reverse() {
 
 	local commit_id=`git_show_head $testroot/repo`
 
-	jot 10 | sed s/5/five/g > $testroot/wt/numbers
+	seq 10 | sed s/5/five/g > $testroot/wt/numbers
 	(cd $testroot/wt && got diff > $testroot/wt/patch \
 		&& got commit -m 'edit numbers') > /dev/null
 	ret=$?
@@ -1722,7 +1722,7 @@ test_patch_merge_reverse() {
 		return 1
 	fi
 
-	jot 10 | sed -e s/5/five/g -e s/6/six/g > $testroot/wt/numbers
+	seq 10 | sed -e s/5/five/g -e s/6/six/g > $testroot/wt/numbers
 	(cd $testroot/wt && got commit -m 'edit numbers again') >/dev/null
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -1966,7 +1966,7 @@ test_patch_commit_keywords() {
 		return 1
 	fi
 
-	jot 10 > $testroot/wt/numbers
+	seq 10 > $testroot/wt/numbers
 	(cd $testroot/wt && got add numbers && got commit -m +numbers) \
 		>/dev/null
 	ret=$?
@@ -1975,13 +1975,13 @@ test_patch_commit_keywords() {
 		return 1
 	fi
 
-	jot 10 | sed s/4/four/ > $testroot/wt/numbers
+	seq 10 | sed s/4/four/ > $testroot/wt/numbers
 
 	# get rid of the metadata
 	(cd $testroot/wt && got diff | sed -n '/^---/,$p' > patch) \
 		>/dev/null
 
-	jot 10 | sed s/6/six/ > $testroot/wt/numbers
+	seq 10 | sed s/6/six/ > $testroot/wt/numbers
 	(cd $testroot/wt && got commit -m 'edit numbers') >/dev/null
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -2005,7 +2005,7 @@ test_patch_commit_keywords() {
 		return 1
 	fi
 
-	jot 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
+	seq 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
 	cmp -s $testroot/wt/numbers $testroot/wt/numbers.expected
 	ret=$?
 	if [ $ret -ne 0 ]; then
@@ -2030,7 +2030,7 @@ test_patch_commit_keywords() {
 		return 1
 	fi
 
-	jot 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
+	seq 10 | sed -e s/4/four/ -e s/6/six/ > $testroot/wt/numbers.expected
 	cmp -s $testroot/wt/numbers $testroot/wt/numbers.expected
 	ret=$?
 	if [ $ret -ne 0 ]; then
blob - 9d0663c277f81746a0e748dfa34bab74a5ac65b5
file + regress/cmdline/revert.sh
--- regress/cmdline/revert.sh
+++ regress/cmdline/revert.sh
@@ -407,7 +407,7 @@ test_revert_missing_directory() {
 test_revert_patch() {
 	local testroot=`test_init revert_patch`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	git -C $testroot/repo add numbers
 	git_commit $testroot/repo -m "added numbers file"
 	local commit_id=`git_show_head $testroot/repo`
@@ -892,7 +892,7 @@ test_revert_patch_removed() {
 test_revert_patch_one_change() {
 	local testroot=`test_init revert_patch_one_change`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	git -C $testroot/repo add numbers
 	git_commit $testroot/repo -m "added numbers file"
 	local commit_id=`git_show_head $testroot/repo`
blob - 7152f7a681f0e4db92a9a9a549bf0079ed7b9f59
file + regress/cmdline/stage.sh
--- regress/cmdline/stage.sh
+++ regress/cmdline/stage.sh
@@ -1440,7 +1440,7 @@ test_stage_commit() {
 test_stage_patch() {
 	local testroot=`test_init stage_patch`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	git -C $testroot/repo add numbers
 	git_commit $testroot/repo -m "added numbers file"
 	local commit_id=`git_show_head $testroot/repo`
@@ -1730,7 +1730,7 @@ EOF
 test_stage_patch_twice() {
 	local testroot=`test_init stage_patch_twice`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	git -C $testroot/repo add numbers
 	git_commit $testroot/repo -m "added numbers file"
 	local commit_id=`git_show_head $testroot/repo`
@@ -2228,7 +2228,7 @@ test_stage_patch_reversed() {
 test_stage_patch_quit() {
 	local testroot=`test_init stage_patch_quit`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	echo zzz > $testroot/repo/zzz
 	git -C $testroot/repo add numbers zzz
 	git_commit $testroot/repo -m "added files"
@@ -2340,7 +2340,7 @@ EOF
 test_stage_patch_incomplete_script() {
 	local testroot=`test_init stage_incomplete_script`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	echo zzz > $testroot/repo/zzz
 	git -C $testroot/repo add numbers zzz
 	git_commit $testroot/repo -m "added files"
blob - 13623342bf573588e2acc70fdd73ada54e46965e
file + regress/cmdline/status.sh
--- regress/cmdline/status.sh
+++ regress/cmdline/status.sh
@@ -336,7 +336,7 @@ test_status_shows_no_mods_after_complete_merge() {
 	local testroot=`test_init status_shows_no_mods_after_complete_merge 1`
 
 	# make this file larger than the usual blob buffer size of 8192
-	jot 16384 > $testroot/repo/numbers
+	seq 16384 > $testroot/repo/numbers
 
 	git -C $testroot/repo add numbers
 	git_commit $testroot/repo -m "added numbers file"
blob - f3dca3415655e74d6079b22ae72d395f55d890eb
file + regress/cmdline/unstage.sh
--- regress/cmdline/unstage.sh
+++ regress/cmdline/unstage.sh
@@ -186,7 +186,7 @@ test_unstage_nonexistent() {
 test_unstage_patch() {
 	local testroot=`test_init unstage_patch`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	git -C $testroot/repo add numbers
 	git_commit $testroot/repo -m "added numbers file"
 	local commit_id=`git_show_head $testroot/repo`
@@ -819,7 +819,7 @@ test_unstage_patch_removed() {
 test_unstage_patch_quit() {
 	local testroot=`test_init unstage_patch_quit`
 
-	jot 16 > $testroot/repo/numbers
+	seq 16 > $testroot/repo/numbers
 	echo zzz > $testroot/repo/zzz
 	git -C $testroot/repo add numbers zzz
 	git_commit $testroot/repo -m "added files"
blob - 4ae6fbc520b21e761719a82232e309e8e3747239
file + regress/gotd/repo_write.sh
--- regress/gotd/repo_write.sh
+++ regress/gotd/repo_write.sh
@@ -175,7 +175,7 @@ test_fetch_more_history() {
 	# Create some more commit history on the main branch.
 	# History needs to be deep enough to trick 'git pull' into sending
 	# a lot of 'have' lines, which triggered a bug in gotd.
-	for i in `jot 50`; do
+	for i in `seq 50`; do
 		echo "more alpha" >> $testroot/wt/alpha
 		(cd $testroot/wt && got commit -m 'more changes' > /dev/null)
 	done