3 af21bb7e 2023-04-12 mark # Copyright (c) 2023 Mark Jamsek <mark@jamsek.dev>
5 af21bb7e 2023-04-12 mark # Permission to use, copy, modify, and distribute this software for any
6 af21bb7e 2023-04-12 mark # purpose with or without fee is hereby granted, provided that the above
7 af21bb7e 2023-04-12 mark # copyright notice and this permission notice appear in all copies.
9 af21bb7e 2023-04-12 mark # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 af21bb7e 2023-04-12 mark # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 af21bb7e 2023-04-12 mark # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 af21bb7e 2023-04-12 mark # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 af21bb7e 2023-04-12 mark # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 af21bb7e 2023-04-12 mark # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 af21bb7e 2023-04-12 mark # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 af21bb7e 2023-04-12 mark . ./common.sh
19 af21bb7e 2023-04-12 mark test_log_hsplit_diff()
21 af21bb7e 2023-04-12 mark test_init log_hsplit_diff
23 af21bb7e 2023-04-12 mark local head_id=`git_show_head $testroot/repo`
24 af21bb7e 2023-04-12 mark local author_time=`git_show_author_time $testroot/repo`
25 af21bb7e 2023-04-12 mark local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
26 af21bb7e 2023-04-12 mark local ymd=`date -u -r $author_time +"%G-%m-%d"`
28 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
29 af21bb7e 2023-04-12 mark KEY_ENTER open diff view of selected commit
30 af21bb7e 2023-04-12 mark S toggle horizontal split
34 af21bb7e 2023-04-12 mark cat <<EOF >$testroot/view.expected
35 af21bb7e 2023-04-12 mark commit $head_id [1/1] master
36 689555c9 2023-05-15 stsp $ymd flan_hacker [master] adding the test tree
41 af21bb7e 2023-04-12 mark --------------------------------------------------------------------------------
42 af21bb7e 2023-04-12 mark [1/40] diff /dev/null $head_id
43 af21bb7e 2023-04-12 mark commit $head_id (master)
44 af21bb7e 2023-04-12 mark from: Flan Hacker <flan_hacker@openbsd.org>
47 af21bb7e 2023-04-12 mark adding the test tree
49 af21bb7e 2023-04-12 mark A alpha | 1+ 0-
50 af21bb7e 2023-04-12 mark A beta | 1+ 0-
51 af21bb7e 2023-04-12 mark A epsilon/zeta | 1+ 0-
52 af21bb7e 2023-04-12 mark A gamma/delta | 1+ 0-
54 af21bb7e 2023-04-12 mark 4 files changed, 4 insertions(+), 0 deletions(-)
56 af21bb7e 2023-04-12 mark commit - /dev/null
57 af21bb7e 2023-04-12 mark commit + $head_id
58 af21bb7e 2023-04-12 mark blob - /dev/null
61 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
62 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
64 af21bb7e 2023-04-12 mark if [ $ret -ne 0 ]; then
65 af21bb7e 2023-04-12 mark diff -u $testroot/view.expected $testroot/view
66 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
70 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
73 af21bb7e 2023-04-12 mark test_log_vsplit_diff()
75 af21bb7e 2023-04-12 mark # make screen wide enough for vsplit
76 af21bb7e 2023-04-12 mark test_init log_vsplit_diff 142
78 af21bb7e 2023-04-12 mark local head_id=`git_show_head $testroot/repo`
79 af21bb7e 2023-04-12 mark local author_time=`git_show_author_time $testroot/repo`
80 af21bb7e 2023-04-12 mark local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
81 af21bb7e 2023-04-12 mark local ymd=`date -u -r $author_time +"%G-%m-%d"`
82 af21bb7e 2023-04-12 mark local blobid_alpha=`get_blob_id $testroot/repo "" alpha`
83 af21bb7e 2023-04-12 mark local blobid_beta=`get_blob_id $testroot/repo "" beta`
85 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
86 af21bb7e 2023-04-12 mark KEY_ENTER open diff view of selected commit in vertical split
90 af21bb7e 2023-04-12 mark cat <<EOF >$testroot/view.expected
91 af21bb7e 2023-04-12 mark commit $head_id [1/1] master |[1/40] diff /dev/null $head_id
92 689555c9 2023-05-15 stsp $ymd flan_hacker [master] adding the test tree |commit $head_id (master)
93 af21bb7e 2023-04-12 mark |from: Flan Hacker <flan_hacker@openbsd.org>
94 af21bb7e 2023-04-12 mark |date: $date
96 af21bb7e 2023-04-12 mark |adding the test tree
98 af21bb7e 2023-04-12 mark |A alpha | 1+ 0-
99 af21bb7e 2023-04-12 mark |A beta | 1+ 0-
100 af21bb7e 2023-04-12 mark |A epsilon/zeta | 1+ 0-
101 af21bb7e 2023-04-12 mark |A gamma/delta | 1+ 0-
103 af21bb7e 2023-04-12 mark |4 files changed, 4 insertions(+), 0 deletions(-)
105 af21bb7e 2023-04-12 mark |commit - /dev/null
106 af21bb7e 2023-04-12 mark |commit + $head_id
107 af21bb7e 2023-04-12 mark |blob - /dev/null
108 af21bb7e 2023-04-12 mark |blob + $blobid_alpha (mode 644)
109 af21bb7e 2023-04-12 mark |--- /dev/null
111 af21bb7e 2023-04-12 mark |@@ -0,0 +1 @@
113 af21bb7e 2023-04-12 mark |blob - /dev/null
114 af21bb7e 2023-04-12 mark |blob + $blobid_beta (mode 644)
117 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
118 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
120 af21bb7e 2023-04-12 mark if [ $ret -ne 0 ]; then
121 af21bb7e 2023-04-12 mark diff -u $testroot/view.expected $testroot/view
122 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
126 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
129 af21bb7e 2023-04-12 mark test_log_show_author()
131 af21bb7e 2023-04-12 mark # make view wide enough to show id
132 af21bb7e 2023-04-12 mark test_init log_show_author 120 4
134 af21bb7e 2023-04-12 mark local head_id=`git_show_head $testroot/repo`
135 af21bb7e 2023-04-12 mark local author_time=`git_show_author_time $testroot/repo`
136 af21bb7e 2023-04-12 mark local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
137 af21bb7e 2023-04-12 mark local ymd=`date -u -r $author_time +"%G-%m-%d"`
138 af21bb7e 2023-04-12 mark local head_id_len8=`trim_obj_id 32 $head_id`
140 af21bb7e 2023-04-12 mark echo "mod alpha" > $testroot/repo/alpha
141 af21bb7e 2023-04-12 mark cd $testroot/repo && git add .
142 af21bb7e 2023-04-12 mark cd $testroot/repo && \
143 af21bb7e 2023-04-12 mark git commit --author "Johnny Cash <john@cash.net>" -m author > \
146 af21bb7e 2023-04-12 mark local commit1=`git_show_head $testroot/repo`
147 af21bb7e 2023-04-12 mark local id1_len8=`trim_obj_id 32 $commit1`
149 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
150 af21bb7e 2023-04-12 mark @ toggle show author
154 af21bb7e 2023-04-12 mark cat <<EOF >$testroot/view.expected
155 af21bb7e 2023-04-12 mark commit $commit1 [1/2] master
156 689555c9 2023-05-15 stsp $ymd $id1_len8 john [master] author
157 af21bb7e 2023-04-12 mark $ymd $head_id_len8 flan_hacker adding the test tree
158 af21bb7e 2023-04-12 mark :show commit author
161 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
162 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
164 af21bb7e 2023-04-12 mark if [ $ret -ne 0 ]; then
165 af21bb7e 2023-04-12 mark diff -u $testroot/view.expected $testroot/view
166 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
170 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
173 af21bb7e 2023-04-12 mark test_log_scroll_right()
175 af21bb7e 2023-04-12 mark test_init log_scroll_right 80 3
177 af21bb7e 2023-04-12 mark local head_id=`git_show_head $testroot/repo`
178 af21bb7e 2023-04-12 mark local author_time=`git_show_author_time $testroot/repo`
179 af21bb7e 2023-04-12 mark local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
180 af21bb7e 2023-04-12 mark local ymd=`date -u -r $author_time +"%G-%m-%d"`
181 af21bb7e 2023-04-12 mark local msg="scroll this log message to the right four characters"
182 689555c9 2023-05-15 stsp local scrolled_msg="ter] scroll this log message to the right four character"
184 af21bb7e 2023-04-12 mark echo "mod alpha" > $testroot/repo/alpha
185 af21bb7e 2023-04-12 mark cd $testroot/repo && git add . && git commit -m "$msg" > /dev/null
187 af21bb7e 2023-04-12 mark local commit1=`git_show_head $testroot/repo`
189 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
190 af21bb7e 2023-04-12 mark l scroll right
191 af21bb7e 2023-04-12 mark l scroll right
195 af21bb7e 2023-04-12 mark cat <<EOF >$testroot/view.expected
196 af21bb7e 2023-04-12 mark commit $commit1 [1/2] master
197 af21bb7e 2023-04-12 mark $ymd flan_hacker $scrolled_msg
198 af21bb7e 2023-04-12 mark $ymd flan_hacker ng the test tree
201 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
202 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
204 af21bb7e 2023-04-12 mark if [ $ret -ne 0 ]; then
205 af21bb7e 2023-04-12 mark diff -u $testroot/view.expected $testroot/view
206 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
210 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
213 af21bb7e 2023-04-12 mark test_log_hsplit_ref()
215 af21bb7e 2023-04-12 mark test_init log_hsplit_ref 80 10
217 af21bb7e 2023-04-12 mark local head_id=`git_show_head $testroot/repo`
218 af21bb7e 2023-04-12 mark local author_time=`git_show_author_time $testroot/repo`
219 af21bb7e 2023-04-12 mark local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
220 af21bb7e 2023-04-12 mark local ymd=`date -u -r $author_time +"%G-%m-%d"`
222 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
223 af21bb7e 2023-04-12 mark R open ref view
224 af21bb7e 2023-04-12 mark S toggle horizontal split
225 af21bb7e 2023-04-12 mark - reduce size of ref view split
229 af21bb7e 2023-04-12 mark cat <<EOF >$testroot/view.expected
230 af21bb7e 2023-04-12 mark commit $head_id [1/1] master
231 689555c9 2023-05-15 stsp $ymd flan_hacker [master] adding the test tree
233 af21bb7e 2023-04-12 mark --------------------------------------------------------------------------------
234 af21bb7e 2023-04-12 mark references [1/2]
235 af21bb7e 2023-04-12 mark HEAD -> refs/heads/master
236 af21bb7e 2023-04-12 mark refs/heads/master
242 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
243 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
245 af21bb7e 2023-04-12 mark if [ $ret -ne 0 ]; then
246 af21bb7e 2023-04-12 mark diff -u $testroot/view.expected $testroot/view
247 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
251 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
254 af21bb7e 2023-04-12 mark test_log_hsplit_tree()
256 af21bb7e 2023-04-12 mark test_init log_hsplit_tree 80 10
258 af21bb7e 2023-04-12 mark local head_id=`git_show_head $testroot/repo`
259 af21bb7e 2023-04-12 mark local author_time=`git_show_author_time $testroot/repo`
260 af21bb7e 2023-04-12 mark local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
261 af21bb7e 2023-04-12 mark local ymd=`date -u -r $author_time +"%G-%m-%d"`
263 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
264 af21bb7e 2023-04-12 mark T open tree view
265 af21bb7e 2023-04-12 mark S toggle horizontal split
266 af21bb7e 2023-04-12 mark j move selection cursor down one entry to "beta"
267 af21bb7e 2023-04-12 mark - reduce size of tree view split
271 af21bb7e 2023-04-12 mark cat <<EOF >$testroot/view.expected
272 af21bb7e 2023-04-12 mark commit $head_id [1/1] master
273 689555c9 2023-05-15 stsp $ymd flan_hacker [master] adding the test tree
275 af21bb7e 2023-04-12 mark --------------------------------------------------------------------------------
276 af21bb7e 2023-04-12 mark commit $head_id
284 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
285 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
287 af21bb7e 2023-04-12 mark if [ $ret -ne 0 ]; then
288 af21bb7e 2023-04-12 mark diff -u $testroot/view.expected $testroot/view
289 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
293 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
296 af21bb7e 2023-04-12 mark test_log_logmsg_widechar()
298 af21bb7e 2023-04-12 mark # make view wide enough to fit logmsg line length
299 af21bb7e 2023-04-12 mark # but short enough so long diff lines are truncated
300 af21bb7e 2023-04-12 mark test_init log_logmsg_widechar 182 30
301 af21bb7e 2023-04-12 mark widechar_commit $testroot/repo
303 af21bb7e 2023-04-12 mark local head_id=`git_show_head $testroot/repo`
304 af21bb7e 2023-04-12 mark local author_time=`git_show_author_time $testroot/repo`
305 af21bb7e 2023-04-12 mark local date=`date -u -r $author_time +"%a %b %e %X %Y UTC"`
306 af21bb7e 2023-04-12 mark local commit1=`git_show_parent_commit $testroot/repo`
307 af21bb7e 2023-04-12 mark local blobid=`get_blob_id $testroot/repo "" $(widechar_filename)`
309 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
310 af21bb7e 2023-04-12 mark KEY_ENTER open selected commit in diff view
311 af21bb7e 2023-04-12 mark F toggle fullscreen
315 af21bb7e 2023-04-12 mark cat <<EOF >$testroot/view.expected
316 af21bb7e 2023-04-12 mark [1/26] diff $commit1 $head_id
317 af21bb7e 2023-04-12 mark commit $head_id (master)
318 af21bb7e 2023-04-12 mark from: Flan Hacker <flan_hacker@openbsd.org>
319 af21bb7e 2023-04-12 mark date: $date
321 af21bb7e 2023-04-12 mark $(widechar_logmsg)
323 af21bb7e 2023-04-12 mark A $(widechar_filename) | 5+ 0-
325 af21bb7e 2023-04-12 mark 1 file changed, 5 insertions(+), 0 deletions(-)
327 af21bb7e 2023-04-12 mark commit - $commit1
328 af21bb7e 2023-04-12 mark commit + $head_id
329 af21bb7e 2023-04-12 mark blob - /dev/null
330 af21bb7e 2023-04-12 mark blob + $blobid (mode 644)
331 af21bb7e 2023-04-12 mark --- /dev/null
332 af21bb7e 2023-04-12 mark +++ $(widechar_filename)
333 af21bb7e 2023-04-12 mark @@ -0,0 +1,5 @@
334 af21bb7e 2023-04-12 mark +ウィリアム・ユワート・グラッドストン(英語: William Ewart Gladstone PC FRS FSS、1809年12月29日 - 1898年5月19日)は、イギリスの政治家。
336 af21bb7e 2023-04-12 mark +ヴィクトリア朝中期から後期にかけて、自由党を指導して、4度にわたり首相を務めた。
338 af21bb7e 2023-04-12 mark +生涯を通じて敬虔なイングランド国教会の信徒であり、キリスト教の精神を政治に反映させることを目指した。多くの自由主義改革を行い、帝国主義にも批判的であった。好敵手である保守党党首ベン
345 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
346 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
348 af21bb7e 2023-04-12 mark if [ $ret -ne 0 ]; then
349 af21bb7e 2023-04-12 mark diff -u $testroot/view.expected $testroot/view
350 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
354 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
357 c4df265e 2023-07-19 mark test_log_commit_keywords()
359 c4df265e 2023-07-19 mark test_init log_commit_keywords 120 10
360 c4df265e 2023-07-19 mark local repo="$testroot/repo"
361 c4df265e 2023-07-19 mark local wt="$testroot/wt"
362 c4df265e 2023-07-19 mark local id=$(git_show_head "$repo")
363 c4df265e 2023-07-19 mark local author_time=$(git_show_author_time "$repo")
364 c4df265e 2023-07-19 mark local ymd=$(date -u -r $author_time +"%G-%m-%d")
366 79c49d84 2023-07-24 mark set -- "$id"
368 c4df265e 2023-07-19 mark got checkout "$repo" "$wt" > /dev/null
370 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
371 c4df265e 2023-07-19 mark echo "got checkout failed unexpectedly"
372 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
376 c4df265e 2023-07-19 mark # move into the work tree (test is run in a subshell)
378 c4df265e 2023-07-19 mark echo -n > alpha
380 c4df265e 2023-07-19 mark for i in $(seq 8); do
381 c4df265e 2023-07-19 mark echo "alpha $i" >> alpha
383 c4df265e 2023-07-19 mark got ci -m "commit $i" > /dev/null
385 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
386 c4df265e 2023-07-19 mark echo "commit failed unexpectedly" >&2
387 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
391 c4df265e 2023-07-19 mark id=$(git_show_head "$repo")
392 79c49d84 2023-07-24 mark set -- "$@" "$id"
395 c4df265e 2023-07-19 mark cat <<-EOF >$TOG_TEST_SCRIPT
396 99301cec 2023-07-24 stsp WAIT_FOR_UI wait for log thread to finish
400 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
401 79c49d84 2023-07-24 mark commit $(pop_idx 5 $@) [1/5]
402 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 5 $@)) flan_hacker commit 4
403 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 4 $@)) flan_hacker commit 3
404 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 3 $@)) flan_hacker commit 2
405 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 2 $@)) flan_hacker commit 1
406 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
413 c4df265e 2023-07-19 mark tog log -c:base:-4
414 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
416 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
417 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
418 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
422 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
423 79c49d84 2023-07-24 mark commit $(pop_idx 7 $@) [1/7]
424 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 7 $@)) flan_hacker commit 6
425 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 6 $@)) flan_hacker commit 5
426 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 5 $@)) flan_hacker commit 4
427 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 4 $@)) flan_hacker commit 3
428 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 3 $@)) flan_hacker commit 2
429 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 2 $@)) flan_hacker commit 1
430 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
435 c4df265e 2023-07-19 mark tog log -r "$repo" -c:head:-2
436 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
438 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
439 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
440 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
444 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
445 79c49d84 2023-07-24 mark commit $(pop_idx 5 $@) [1/5]
446 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 5 $@)) flan_hacker commit 4
447 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 4 $@)) flan_hacker commit 3
448 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 3 $@)) flan_hacker ~commit 2
449 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 2 $@)) flan_hacker commit 1
450 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
457 c4df265e 2023-07-19 mark got up -c:base:-6 > /dev/null
459 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
460 c4df265e 2023-07-19 mark echo "got update failed unexpectedly"
461 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
465 c4df265e 2023-07-19 mark tog log -c:base:+2
466 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
468 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
469 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
470 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
474 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
475 79c49d84 2023-07-24 mark commit $(pop_idx 1 $@) [1/1]
476 79c49d84 2023-07-24 mark $ymd $(trim_obj_id 32 $(pop_idx 1 $@)) flan_hacker adding the test tree
487 c4df265e 2023-07-19 mark tog log -c:base:-99
488 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
490 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
491 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
492 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
496 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
499 c935fd51 2023-07-23 mark test_log_show_base_commit()
501 c935fd51 2023-07-23 mark # make view wide enough to show full headline
502 c935fd51 2023-07-23 mark test_init log_show_base_commit 80 3
503 c935fd51 2023-07-23 mark local repo="$testroot/repo"
504 c935fd51 2023-07-23 mark local id=$(git_show_head "$repo")
506 c935fd51 2023-07-23 mark echo "alpha" >> "$repo/alpha"
507 c935fd51 2023-07-23 mark git_commit "$repo" -m "base commit"
509 c935fd51 2023-07-23 mark got checkout "$repo" "$testroot/wt" > /dev/null
511 c935fd51 2023-07-23 mark if [ $ret -ne 0 ]; then
512 c935fd51 2023-07-23 mark echo "got checkout failed unexpectedly"
513 c935fd51 2023-07-23 mark test_done "$testroot" "$ret"
517 c935fd51 2023-07-23 mark # move into the work tree (test is run in a subshell)
518 c935fd51 2023-07-23 mark cd "$testroot/wt"
520 c935fd51 2023-07-23 mark local head_id=$(git_show_head "$repo")
521 c935fd51 2023-07-23 mark local author_time=$(git_show_author_time "$repo")
522 c935fd51 2023-07-23 mark local ymd=$(date -u -r "$author_time" +"%G-%m-%d")
524 c935fd51 2023-07-23 mark # check up-to-date base commit marker prefixes base commit log message
525 c935fd51 2023-07-23 mark cat <<-EOF >$TOG_TEST_SCRIPT
526 99301cec 2023-07-24 stsp WAIT_FOR_UI wait for log thread to finish
530 c935fd51 2023-07-23 mark cat <<-EOF >$testroot/view.expected
531 c935fd51 2023-07-23 mark commit $head_id [1/2] master
532 c935fd51 2023-07-23 mark $ymd flan_hacker *[master] base commit
533 c935fd51 2023-07-23 mark $ymd flan_hacker adding the test tree
537 c935fd51 2023-07-23 mark cmp -s "$testroot/view.expected" "$testroot/view"
539 c935fd51 2023-07-23 mark if [ $ret -ne 0 ]; then
540 c935fd51 2023-07-23 mark diff -u "$testroot/view.expected" "$testroot/view"
541 c935fd51 2023-07-23 mark test_done "$testroot" "$ret"
545 c935fd51 2023-07-23 mark # check marker is not drawn when not in a work tree
546 c935fd51 2023-07-23 mark cat <<-EOF >$testroot/view.expected
547 c935fd51 2023-07-23 mark commit $head_id [1/2] master
548 c935fd51 2023-07-23 mark $ymd flan_hacker [master] base commit
549 c935fd51 2023-07-23 mark $ymd flan_hacker adding the test tree
552 c935fd51 2023-07-23 mark tog log -r "$repo"
553 c935fd51 2023-07-23 mark cmp -s "$testroot/view.expected" "$testroot/view"
555 c935fd51 2023-07-23 mark if [ $ret -ne 0 ]; then
556 c935fd51 2023-07-23 mark diff -u "$testroot/view.expected" "$testroot/view"
557 c935fd51 2023-07-23 mark test_done "$testroot" "$ret"
561 c935fd51 2023-07-23 mark # check out-of-date marker is shown with a mixed-commit tree
562 c935fd51 2023-07-23 mark echo "mixed" > alpha
563 c935fd51 2023-07-23 mark got commit -m "new base mixed-commit" > /dev/null
564 c935fd51 2023-07-23 mark head_id=$(git_show_head "$repo")
566 c935fd51 2023-07-23 mark cat <<-EOF >$TOG_TEST_SCRIPT
567 99301cec 2023-07-24 stsp WAIT_FOR_UI wait for log thread to finish
571 c935fd51 2023-07-23 mark cat <<-EOF >$testroot/view.expected
572 c935fd51 2023-07-23 mark commit $head_id [1/3] master
573 c935fd51 2023-07-23 mark $ymd flan_hacker ~[master] new base mixed-commit
574 c935fd51 2023-07-23 mark $ymd flan_hacker base commit
578 f641a707 2023-09-05 mark cmp -s "$testroot/view.expected" "$testroot/view"
580 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
581 f641a707 2023-09-05 mark diff -u "$testroot/view.expected" "$testroot/view"
582 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
586 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
589 f641a707 2023-09-05 mark test_log_limit_view()
591 f641a707 2023-09-05 mark test_init log_limit_view 80 4
592 f641a707 2023-09-05 mark local repo="$testroot/repo"
593 f641a707 2023-09-05 mark local wt="$testroot/wt"
595 f641a707 2023-09-05 mark got checkout "$repo" "$wt" > /dev/null
597 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
598 f641a707 2023-09-05 mark echo "got checkout failed unexpectedly"
599 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
605 f641a707 2023-09-05 mark echo "alpha0" > alpha
606 f641a707 2023-09-05 mark got commit -m alpha0 > /dev/null
608 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
609 f641a707 2023-09-05 mark echo "got commit failed unexpectedly" >&2
610 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
614 f641a707 2023-09-05 mark echo "beta0" > beta
615 f641a707 2023-09-05 mark got commit -m beta0 > /dev/null
617 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
618 f641a707 2023-09-05 mark echo "got commit failed unexpectedly" >&2
619 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
623 f641a707 2023-09-05 mark echo "alpha1" > alpha
624 f641a707 2023-09-05 mark got commit -m alpha1 > /dev/null
626 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
627 f641a707 2023-09-05 mark echo "got commit failed unexpectedly" >&2
628 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
632 f641a707 2023-09-05 mark echo "beta1" > beta
633 f641a707 2023-09-05 mark got commit -m beta1 > /dev/null
635 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
636 f641a707 2023-09-05 mark echo "got commit failed unexpectedly" >&2
637 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
640 f641a707 2023-09-05 mark local author_time=$(git_show_author_time "$repo")
641 f641a707 2023-09-05 mark local ymd=$(date -u -r $author_time +"%G-%m-%d")
642 f641a707 2023-09-05 mark local id=$(git_show_head "$repo")
644 f641a707 2023-09-05 mark # check base commit marker is not drawn
645 f641a707 2023-09-05 mark cat <<-EOF >$TOG_TEST_SCRIPT
650 f641a707 2023-09-05 mark cat <<-EOF >$testroot/view.expected
651 f641a707 2023-09-05 mark commit $id [1/2] master
652 f641a707 2023-09-05 mark $ymd flan_hacker [master] beta1
653 f641a707 2023-09-05 mark $ymd flan_hacker beta0
658 c935fd51 2023-07-23 mark cmp -s "$testroot/view.expected" "$testroot/view"
660 c935fd51 2023-07-23 mark if [ $ret -ne 0 ]; then
661 c935fd51 2023-07-23 mark diff -u "$testroot/view.expected" "$testroot/view"
663 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
666 f641a707 2023-09-05 mark test_log_search()
668 f641a707 2023-09-05 mark test_init log_search 80 8
669 f641a707 2023-09-05 mark local repo="$testroot/repo"
670 f641a707 2023-09-05 mark local wt="$testroot/wt"
671 f641a707 2023-09-05 mark local id=$(git_show_head "$repo")
673 f641a707 2023-09-05 mark set -- "$id"
675 f641a707 2023-09-05 mark got checkout "$repo" "$wt" > /dev/null
677 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
678 f641a707 2023-09-05 mark echo "got checkout failed unexpectedly"
679 c935fd51 2023-07-23 mark test_done "$testroot" "$ret"
685 f641a707 2023-09-05 mark for i in $(seq 16); do
686 f641a707 2023-09-05 mark echo "alpha $i" > alpha
688 f641a707 2023-09-05 mark got ci -m "alpha commit $i" > /dev/null
690 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
691 f641a707 2023-09-05 mark echo "got commit failed unexpectedly" >&2
692 f641a707 2023-09-05 mark test_done "$testroot" "$ret"
696 f641a707 2023-09-05 mark id=$(git_show_head "$repo")
697 f641a707 2023-09-05 mark set -- "$@" "$id"
700 f641a707 2023-09-05 mark local author_time=$(git_show_author_time "$repo")
701 f641a707 2023-09-05 mark local ymd=$(date -u -r $author_time +"%G-%m-%d")
703 f641a707 2023-09-05 mark cat <<-EOF >$TOG_TEST_SCRIPT
704 f641a707 2023-09-05 mark /alpha commit 8
709 f641a707 2023-09-05 mark cat <<-EOF >$testroot/view.expected
710 f641a707 2023-09-05 mark commit $(pop_idx 9 $@) [9/17] no more matches
711 f641a707 2023-09-05 mark $ymd flan_hacker alpha commit 14
712 f641a707 2023-09-05 mark $ymd flan_hacker alpha commit 13
713 f641a707 2023-09-05 mark $ymd flan_hacker alpha commit 12
714 f641a707 2023-09-05 mark $ymd flan_hacker alpha commit 11
715 f641a707 2023-09-05 mark $ymd flan_hacker alpha commit 10
716 f641a707 2023-09-05 mark $ymd flan_hacker alpha commit 9
717 f641a707 2023-09-05 mark $ymd flan_hacker alpha commit 8
721 f641a707 2023-09-05 mark cmp -s "$testroot/view.expected" "$testroot/view"
723 f641a707 2023-09-05 mark if [ $ret -ne 0 ]; then
724 f641a707 2023-09-05 mark diff -u "$testroot/view.expected" "$testroot/view"
726 c935fd51 2023-07-23 mark test_done "$testroot" "$ret"
729 af21bb7e 2023-04-12 mark test_parseargs "$@"
730 af21bb7e 2023-04-12 mark run_test test_log_hsplit_diff
731 af21bb7e 2023-04-12 mark run_test test_log_vsplit_diff
732 af21bb7e 2023-04-12 mark run_test test_log_show_author
733 af21bb7e 2023-04-12 mark run_test test_log_scroll_right
734 af21bb7e 2023-04-12 mark run_test test_log_hsplit_ref
735 af21bb7e 2023-04-12 mark run_test test_log_hsplit_tree
736 af21bb7e 2023-04-12 mark run_test test_log_logmsg_widechar
737 c4df265e 2023-07-19 mark run_test test_log_commit_keywords
738 c935fd51 2023-07-23 mark run_test test_log_show_base_commit
739 f641a707 2023-09-05 mark run_test test_log_limit_view
740 f641a707 2023-09-05 mark run_test test_log_search