From: Omar Polo Subject: regress/tog: enable in sha256 mode To: gameoftrees@openbsd.org Date: Tue, 06 Aug 2024 23:33:40 +0200 i'm not sure if it's better to do this or enlarge the size of the screen so we don't have to wrap. it is fully passing :) diff /home/op/w/got commit - e016e61067cb2f0b9e60bd6127aff65dc1f977ec path + /home/op/w/got blob - 9fbf11cc0f5d4ed9d2e5dbc4d4461b1e50b9db14 file + regress/tog/common.sh --- regress/tog/common.sh +++ regress/tog/common.sh @@ -77,6 +77,11 @@ set_test_env() fi } +trim() +{ + expr "$2" : "\(.\{$1\}\)" +} + test_init() { local testname="$1" @@ -106,7 +111,6 @@ test_init() run_test() { testfunc="$1" - limits="$2" if [ -n "$regress_run_only" ]; then case "$regress_run_only" in @@ -115,10 +119,6 @@ run_test() esac fi - if [ "${GOT_TEST_ALGO}" = sha256 -a -z "$limits" ]; then - return - fi - if [ -z "$GOT_TEST_QUIET" ]; then echo -n "$testfunc " fi blob - a0945c59f1b465237892c32f9f441c9c57773cca file + regress/tog/diff.sh --- regress/tog/diff.sh +++ regress/tog/diff.sh @@ -36,7 +36,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -[1/20] diff $commit_id1 $head_id_truncated +$(trim 80 "[1/20] diff $commit_id1 $head_id_truncated") commit $head_id (master) from: Flan Hacker date: $date @@ -99,7 +99,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -[1/16] diff $commit_id1 $head_id_truncated +$(trim 80 "[1/16] diff $commit_id1 $head_id_truncated") commit - $commit_id1 commit + $head_id blob - $alpha_id_old @@ -110,7 +110,7 @@ blob + $alpha_id -alpha +modified alpha again blob - /dev/null -blob + $new_id (mode 644) +$(trim 80 "blob + $new_id (mode 644)") --- /dev/null +++ new @@ -0,0 +1 @@ @@ -180,7 +180,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -[1/20] diff $id6 $id7 +$(trim 94 "[1/20] diff $id6 $id7") commit $id7 from: Flan Hacker date: $date7 @@ -228,7 +228,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -[1/20] diff $id25 $id26 +$(trim 94 "[1/20] diff $id25 $id26") commit $id26 from: Flan Hacker date: $date26 @@ -276,7 +276,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -[1/20] diff $id6 $id7 +$(trim 94 "[1/20] diff $id6 $id7") commit $id7 from: Flan Hacker date: $date7 @@ -364,7 +364,7 @@ test_diff_commit_keywords() local date=$(date -u -r $(pop_idx 2 $@) +"%a %b %e %X %Y UTC") cat <<-EOF >$testroot/view.expected - [1/20] diff $lhs_id $rhs_id + $(trim 120 "[1/20] diff $lhs_id $rhs_id") commit $rhs_id from: Flan Hacker date: $date @@ -404,7 +404,7 @@ test_diff_commit_keywords() rhs_id=$(pop_idx 8 $ids) cat <<-EOF >$testroot/view.expected - [1/10] diff $lhs_id $rhs_id + $(trim 120 "[1/10] diff $lhs_id $rhs_id") commit - $lhs_id commit + $rhs_id blob - $(pop_idx 5 $alpha_ids) @@ -508,7 +508,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -[1/20] diff $commit_id1 $head_id_truncated +$(trim 80 "[1/20] diff $commit_id1 $head_id_truncated") $head_id (master) Flan Hacker $date blob - 58c10dafb6236aba27ddab7d849f0e5fbb825d8b file + regress/tog/log.sh --- regress/tog/log.sh +++ regress/tog/log.sh @@ -32,14 +32,14 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $head_id [1/1] master +$(trim 80 "commit $head_id [1/1] master") $ymd flan_hacker [master] adding the test tree -------------------------------------------------------------------------------- -[1/40] diff /dev/null $head_id +$(trim 80 "[1/40] diff /dev/null $head_id") commit $head_id (master) from: Flan Hacker date: $date @@ -88,7 +88,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $head_id [1/1] master |[1/40] diff /dev/null $head_id +$(trim 61 "commit $head_id [1/1] master ")|$(trim 80 "[1/40] diff /dev/null $head_id") $ymd flan_hacker [master] adding the test tree |commit $head_id (master) |from: Flan Hacker |date: $date @@ -105,13 +105,13 @@ $ymd flan_hacker [master] adding the test tree |commit - /dev/null |commit + $head_id |blob - /dev/null - |blob + $blobid_alpha (mode 644) + |$(trim 80 "blob + $blobid_alpha (mode 644)") |--- /dev/null |+++ alpha |@@ -0,0 +1 @@ |+alpha |blob - /dev/null - |blob + $blobid_beta (mode 644) + |$(trim 80 "blob + $blobid_beta (mode 644)") EOF cd $testroot/repo && tog log @@ -193,7 +193,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $commit1 [1/2] master +$(trim 80 "commit $commit1 [1/2] master") $ymd flan_hacker $scrolled_msg $ymd flan_hacker ng the test tree EOF @@ -227,7 +227,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $head_id [1/1] master +$(trim 80 "commit $head_id [1/1] master") $ymd flan_hacker [master] adding the test tree -------------------------------------------------------------------------------- @@ -269,7 +269,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $head_id [1/1] master +$(trim 80 "commit $head_id [1/1] master") $ymd flan_hacker [master] adding the test tree -------------------------------------------------------------------------------- @@ -528,7 +528,7 @@ test_log_show_base_commit() EOF cat <<-EOF >$testroot/view.expected - commit $head_id [1/2] master + $(trim 80 "commit $head_id [1/2] master") $ymd flan_hacker *[master] base commit $ymd flan_hacker adding the test tree EOF @@ -544,7 +544,7 @@ test_log_show_base_commit() # check marker is not drawn when not in a work tree cat <<-EOF >$testroot/view.expected - commit $head_id [1/2] master + $(trim 80 "commit $head_id [1/2] master") $ymd flan_hacker [master] base commit $ymd flan_hacker adding the test tree EOF @@ -569,7 +569,7 @@ test_log_show_base_commit() EOF cat <<-EOF >$testroot/view.expected - commit $head_id [1/3] master + $(trim 80 "commit $head_id [1/3] master") $ymd flan_hacker ~[master] new base mixed-commit $ymd flan_hacker base commit EOF @@ -648,7 +648,7 @@ test_log_limit_view() EOF cat <<-EOF >$testroot/view.expected - commit $id [1/2] master + $(trim 80 "commit $id [1/2] master") $ymd flan_hacker [master] beta1 $ymd flan_hacker beta0 @@ -707,7 +707,7 @@ test_log_search() EOF cat <<-EOF >$testroot/view.expected - commit $(pop_idx 9 $@) [9/17] no more matches + $(trim 80 "commit $(pop_idx 9 $@) [9/17] no more matches") $ymd flan_hacker alpha commit 14 $ymd flan_hacker alpha commit 13 $ymd flan_hacker alpha commit 12 blob - 5cbc7739a8711a9a4c7f9cd93e48ae4fa9be6cf4 file + regress/tog/tree.sh --- regress/tog/tree.sh +++ regress/tog/tree.sh @@ -27,7 +27,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $head_id +$(trim 48 "commit $head_id") [1/4] / alpha @@ -104,7 +104,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $head_id +$(trim 48 "commit $head_id") [2/4] / alpha @@ -115,7 +115,7 @@ commit $head_id ------------------------------------------------ -commit $head_id +$(trim 48 "commit $head_id") [1/1] /beta $head_id_short beta @@ -156,7 +156,7 @@ SCREENDUMP EOF cat <$testroot/view.expected -commit $head_id +$(trim 48 "commit $head_id") [1/5] / alpha @@ -224,7 +224,7 @@ test_tree_commit_keywords() EOF cat <<-EOF >$testroot/view.expected - commit $(pop_idx 8 $@) + $(trim 48 "commit $(pop_idx 8 $@)") [1/7] / alpha @@ -247,7 +247,7 @@ test_tree_commit_keywords() fi cat <<-EOF >$testroot/view.expected - commit $(pop_idx 6 $@) + $(trim 48 "commit $(pop_idx 6 $@)") [1/6] / alpha @@ -270,7 +270,7 @@ test_tree_commit_keywords() fi cat <<-EOF >$testroot/view.expected - commit $(pop_idx 9 $@) + $(trim 48 "commit $(pop_idx 9 $@)") [1/8] / alpha @@ -294,7 +294,7 @@ test_tree_commit_keywords() fi cat <<-EOF >$testroot/view.expected - commit $(pop_idx 4 $@) + $(trim 48 "commit $(pop_idx 4 $@)") [1/5] / alpha @@ -317,7 +317,7 @@ test_tree_commit_keywords() fi cat <<-EOF >$testroot/view.expected - commit $(pop_idx 1 $@) + $(trim 48 "commit $(pop_idx 1 $@)") [1/4] / alpha