Blame


1 af21bb7e 2023-04-12 mark #!/bin/sh
2 af21bb7e 2023-04-12 mark #
3 af21bb7e 2023-04-12 mark # Copyright (c) 2023 Mark Jamsek <mark@jamsek.dev>
4 af21bb7e 2023-04-12 mark #
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.
8 af21bb7e 2023-04-12 mark #
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.
16 af21bb7e 2023-04-12 mark
17 af21bb7e 2023-04-12 mark . ./common.sh
18 af21bb7e 2023-04-12 mark
19 af21bb7e 2023-04-12 mark test_log_hsplit_diff()
20 af21bb7e 2023-04-12 mark {
21 af21bb7e 2023-04-12 mark test_init log_hsplit_diff
22 af21bb7e 2023-04-12 mark
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"`
27 af21bb7e 2023-04-12 mark
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
31 af21bb7e 2023-04-12 mark SCREENDUMP
32 af21bb7e 2023-04-12 mark EOF
33 af21bb7e 2023-04-12 mark
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
37 af21bb7e 2023-04-12 mark
38 af21bb7e 2023-04-12 mark
39 af21bb7e 2023-04-12 mark
40 af21bb7e 2023-04-12 mark
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>
45 af21bb7e 2023-04-12 mark date: $date
46 af21bb7e 2023-04-12 mark
47 af21bb7e 2023-04-12 mark adding the test tree
48 af21bb7e 2023-04-12 mark
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-
53 af21bb7e 2023-04-12 mark
54 af21bb7e 2023-04-12 mark 4 files changed, 4 insertions(+), 0 deletions(-)
55 af21bb7e 2023-04-12 mark
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
59 af21bb7e 2023-04-12 mark EOF
60 af21bb7e 2023-04-12 mark
61 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
62 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
63 af21bb7e 2023-04-12 mark ret=$?
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"
67 af21bb7e 2023-04-12 mark return 1
68 af21bb7e 2023-04-12 mark fi
69 af21bb7e 2023-04-12 mark
70 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
71 af21bb7e 2023-04-12 mark }
72 af21bb7e 2023-04-12 mark
73 af21bb7e 2023-04-12 mark test_log_vsplit_diff()
74 af21bb7e 2023-04-12 mark {
75 af21bb7e 2023-04-12 mark # make screen wide enough for vsplit
76 af21bb7e 2023-04-12 mark test_init log_vsplit_diff 142
77 af21bb7e 2023-04-12 mark
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`
84 af21bb7e 2023-04-12 mark
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
87 af21bb7e 2023-04-12 mark SCREENDUMP
88 af21bb7e 2023-04-12 mark EOF
89 af21bb7e 2023-04-12 mark
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
95 af21bb7e 2023-04-12 mark |
96 af21bb7e 2023-04-12 mark |adding the test tree
97 af21bb7e 2023-04-12 mark |
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-
102 af21bb7e 2023-04-12 mark |
103 af21bb7e 2023-04-12 mark |4 files changed, 4 insertions(+), 0 deletions(-)
104 af21bb7e 2023-04-12 mark |
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
110 af21bb7e 2023-04-12 mark |+++ alpha
111 af21bb7e 2023-04-12 mark |@@ -0,0 +1 @@
112 af21bb7e 2023-04-12 mark |+alpha
113 af21bb7e 2023-04-12 mark |blob - /dev/null
114 af21bb7e 2023-04-12 mark |blob + $blobid_beta (mode 644)
115 af21bb7e 2023-04-12 mark EOF
116 af21bb7e 2023-04-12 mark
117 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
118 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
119 af21bb7e 2023-04-12 mark ret=$?
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"
123 af21bb7e 2023-04-12 mark return 1
124 af21bb7e 2023-04-12 mark fi
125 af21bb7e 2023-04-12 mark
126 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
127 af21bb7e 2023-04-12 mark }
128 af21bb7e 2023-04-12 mark
129 af21bb7e 2023-04-12 mark test_log_show_author()
130 af21bb7e 2023-04-12 mark {
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
133 af21bb7e 2023-04-12 mark
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`
139 af21bb7e 2023-04-12 mark
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 > \
144 af21bb7e 2023-04-12 mark /dev/null
145 af21bb7e 2023-04-12 mark
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`
148 af21bb7e 2023-04-12 mark
149 5bde4759 2023-04-15 mark cat <<EOF >$TOG_TEST_SCRIPT
150 af21bb7e 2023-04-12 mark @ toggle show author
151 af21bb7e 2023-04-12 mark SCREENDUMP
152 af21bb7e 2023-04-12 mark EOF
153 af21bb7e 2023-04-12 mark
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
159 af21bb7e 2023-04-12 mark EOF
160 af21bb7e 2023-04-12 mark
161 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
162 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
163 af21bb7e 2023-04-12 mark ret=$?
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"
167 af21bb7e 2023-04-12 mark return 1
168 af21bb7e 2023-04-12 mark fi
169 af21bb7e 2023-04-12 mark
170 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
171 af21bb7e 2023-04-12 mark }
172 af21bb7e 2023-04-12 mark
173 af21bb7e 2023-04-12 mark test_log_scroll_right()
174 af21bb7e 2023-04-12 mark {
175 af21bb7e 2023-04-12 mark test_init log_scroll_right 80 3
176 af21bb7e 2023-04-12 mark
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"
183 af21bb7e 2023-04-12 mark
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
186 af21bb7e 2023-04-12 mark
187 af21bb7e 2023-04-12 mark local commit1=`git_show_head $testroot/repo`
188 af21bb7e 2023-04-12 mark
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
192 af21bb7e 2023-04-12 mark SCREENDUMP
193 af21bb7e 2023-04-12 mark EOF
194 af21bb7e 2023-04-12 mark
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
199 af21bb7e 2023-04-12 mark EOF
200 af21bb7e 2023-04-12 mark
201 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
202 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
203 af21bb7e 2023-04-12 mark ret=$?
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"
207 af21bb7e 2023-04-12 mark return 1
208 af21bb7e 2023-04-12 mark fi
209 af21bb7e 2023-04-12 mark
210 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
211 af21bb7e 2023-04-12 mark }
212 af21bb7e 2023-04-12 mark
213 af21bb7e 2023-04-12 mark test_log_hsplit_ref()
214 af21bb7e 2023-04-12 mark {
215 af21bb7e 2023-04-12 mark test_init log_hsplit_ref 80 10
216 af21bb7e 2023-04-12 mark
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"`
221 af21bb7e 2023-04-12 mark
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
226 af21bb7e 2023-04-12 mark SCREENDUMP
227 af21bb7e 2023-04-12 mark EOF
228 af21bb7e 2023-04-12 mark
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
232 af21bb7e 2023-04-12 mark
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
237 af21bb7e 2023-04-12 mark
238 af21bb7e 2023-04-12 mark
239 af21bb7e 2023-04-12 mark
240 af21bb7e 2023-04-12 mark EOF
241 af21bb7e 2023-04-12 mark
242 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
243 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
244 af21bb7e 2023-04-12 mark ret=$?
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"
248 af21bb7e 2023-04-12 mark return 1
249 af21bb7e 2023-04-12 mark fi
250 af21bb7e 2023-04-12 mark
251 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
252 af21bb7e 2023-04-12 mark }
253 af21bb7e 2023-04-12 mark
254 af21bb7e 2023-04-12 mark test_log_hsplit_tree()
255 af21bb7e 2023-04-12 mark {
256 af21bb7e 2023-04-12 mark test_init log_hsplit_tree 80 10
257 af21bb7e 2023-04-12 mark
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"`
262 af21bb7e 2023-04-12 mark
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
268 af21bb7e 2023-04-12 mark SCREENDUMP
269 af21bb7e 2023-04-12 mark EOF
270 af21bb7e 2023-04-12 mark
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
274 af21bb7e 2023-04-12 mark
275 af21bb7e 2023-04-12 mark --------------------------------------------------------------------------------
276 af21bb7e 2023-04-12 mark commit $head_id
277 af21bb7e 2023-04-12 mark [2/4] /
278 af21bb7e 2023-04-12 mark
279 af21bb7e 2023-04-12 mark alpha
280 af21bb7e 2023-04-12 mark beta
281 af21bb7e 2023-04-12 mark epsilon/
282 af21bb7e 2023-04-12 mark EOF
283 af21bb7e 2023-04-12 mark
284 af21bb7e 2023-04-12 mark cd $testroot/repo && tog log
285 af21bb7e 2023-04-12 mark cmp -s $testroot/view.expected $testroot/view
286 af21bb7e 2023-04-12 mark ret=$?
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"
290 af21bb7e 2023-04-12 mark return 1
291 af21bb7e 2023-04-12 mark fi
292 af21bb7e 2023-04-12 mark
293 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
294 af21bb7e 2023-04-12 mark }
295 af21bb7e 2023-04-12 mark
296 af21bb7e 2023-04-12 mark test_log_logmsg_widechar()
297 af21bb7e 2023-04-12 mark {
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
302 af21bb7e 2023-04-12 mark
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)`
308 af21bb7e 2023-04-12 mark
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
312 af21bb7e 2023-04-12 mark SCREENDUMP
313 af21bb7e 2023-04-12 mark EOF
314 af21bb7e 2023-04-12 mark
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
320 af21bb7e 2023-04-12 mark
321 af21bb7e 2023-04-12 mark $(widechar_logmsg)
322 af21bb7e 2023-04-12 mark
323 af21bb7e 2023-04-12 mark A $(widechar_filename) | 5+ 0-
324 af21bb7e 2023-04-12 mark
325 af21bb7e 2023-04-12 mark 1 file changed, 5 insertions(+), 0 deletions(-)
326 af21bb7e 2023-04-12 mark
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日)は、イギリスの政治家。
335 af21bb7e 2023-04-12 mark +
336 af21bb7e 2023-04-12 mark +ヴィクトリア朝中期から後期にかけて、自由党を指導して、4度にわたり首相を務めた。
337 af21bb7e 2023-04-12 mark +
338 af21bb7e 2023-04-12 mark +生涯を通じて敬虔なイングランド国教会の信徒であり、キリスト教の精神を政治に反映させることを目指した。多くの自由主義改革を行い、帝国主義にも批判的であった。好敵手である保守党党首ベン
339 af21bb7e 2023-04-12 mark
340 af21bb7e 2023-04-12 mark
341 af21bb7e 2023-04-12 mark
342 af21bb7e 2023-04-12 mark (END)
343 af21bb7e 2023-04-12 mark EOF
344 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
347 af21bb7e 2023-04-12 mark ret=$?
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"
351 c4df265e 2023-07-19 mark return 1
352 c4df265e 2023-07-19 mark fi
353 c4df265e 2023-07-19 mark
354 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
355 c4df265e 2023-07-19 mark }
356 c4df265e 2023-07-19 mark
357 c4df265e 2023-07-19 mark test_log_commit_keywords()
358 c4df265e 2023-07-19 mark {
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")
365 c4df265e 2023-07-19 mark
366 c4df265e 2023-07-19 mark set -A ids "$id"
367 c4df265e 2023-07-19 mark set -A short_ids "$(trim_obj_id 32 $id)"
368 c4df265e 2023-07-19 mark
369 c4df265e 2023-07-19 mark got checkout "$repo" "$wt" > /dev/null
370 c4df265e 2023-07-19 mark ret=$?
371 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
372 c4df265e 2023-07-19 mark echo "got checkout failed unexpectedly"
373 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
374 c4df265e 2023-07-19 mark return 1
375 c4df265e 2023-07-19 mark fi
376 c4df265e 2023-07-19 mark
377 c4df265e 2023-07-19 mark # move into the work tree (test is run in a subshell)
378 c4df265e 2023-07-19 mark cd "$wt"
379 c4df265e 2023-07-19 mark echo -n > alpha
380 c4df265e 2023-07-19 mark
381 c4df265e 2023-07-19 mark for i in $(seq 8); do
382 c4df265e 2023-07-19 mark echo "alpha $i" >> alpha
383 c4df265e 2023-07-19 mark
384 c4df265e 2023-07-19 mark got ci -m "commit $i" > /dev/null
385 c4df265e 2023-07-19 mark ret=$?
386 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
387 c4df265e 2023-07-19 mark echo "commit failed unexpectedly" >&2
388 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
389 c4df265e 2023-07-19 mark return 1
390 c4df265e 2023-07-19 mark fi
391 c4df265e 2023-07-19 mark
392 c4df265e 2023-07-19 mark id=$(git_show_head "$repo")
393 c4df265e 2023-07-19 mark set -- "$ids" "$id"
394 c4df265e 2023-07-19 mark ids=$*
395 c4df265e 2023-07-19 mark set -- "$short_ids" "$(trim_obj_id 32 $id)"
396 c4df265e 2023-07-19 mark short_ids=$*
397 c4df265e 2023-07-19 mark done
398 c4df265e 2023-07-19 mark
399 c4df265e 2023-07-19 mark cat <<-EOF >$TOG_TEST_SCRIPT
400 c4df265e 2023-07-19 mark SCREENDUMP
401 c4df265e 2023-07-19 mark EOF
402 c4df265e 2023-07-19 mark
403 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
404 c4df265e 2023-07-19 mark commit $(pop_id 5 $ids) [1/5]
405 c4df265e 2023-07-19 mark $ymd $(pop_id 5 $short_ids) flan_hacker commit 4
406 c4df265e 2023-07-19 mark $ymd $(pop_id 4 $short_ids) flan_hacker commit 3
407 c4df265e 2023-07-19 mark $ymd $(pop_id 3 $short_ids) flan_hacker commit 2
408 c4df265e 2023-07-19 mark $ymd $(pop_id 2 $short_ids) flan_hacker commit 1
409 c4df265e 2023-07-19 mark $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
410 c4df265e 2023-07-19 mark
411 c4df265e 2023-07-19 mark
412 c4df265e 2023-07-19 mark
413 c4df265e 2023-07-19 mark
414 c4df265e 2023-07-19 mark EOF
415 c4df265e 2023-07-19 mark
416 c4df265e 2023-07-19 mark tog log -c:base:-4
417 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
418 c4df265e 2023-07-19 mark ret=$?
419 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
420 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
421 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
422 c4df265e 2023-07-19 mark return 1
423 c4df265e 2023-07-19 mark fi
424 c4df265e 2023-07-19 mark
425 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
426 c4df265e 2023-07-19 mark commit $(pop_id 7 $ids) [1/7]
427 c4df265e 2023-07-19 mark $ymd $(pop_id 7 $short_ids) flan_hacker commit 6
428 c4df265e 2023-07-19 mark $ymd $(pop_id 6 $short_ids) flan_hacker commit 5
429 c4df265e 2023-07-19 mark $ymd $(pop_id 5 $short_ids) flan_hacker commit 4
430 c4df265e 2023-07-19 mark $ymd $(pop_id 4 $short_ids) flan_hacker commit 3
431 c4df265e 2023-07-19 mark $ymd $(pop_id 3 $short_ids) flan_hacker commit 2
432 c4df265e 2023-07-19 mark $ymd $(pop_id 2 $short_ids) flan_hacker commit 1
433 c4df265e 2023-07-19 mark $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
434 c4df265e 2023-07-19 mark
435 c4df265e 2023-07-19 mark
436 c4df265e 2023-07-19 mark EOF
437 c4df265e 2023-07-19 mark
438 c4df265e 2023-07-19 mark tog log -r "$repo" -c:head:-2
439 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
440 c4df265e 2023-07-19 mark ret=$?
441 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
442 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
443 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
444 af21bb7e 2023-04-12 mark return 1
445 af21bb7e 2023-04-12 mark fi
446 af21bb7e 2023-04-12 mark
447 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
448 c4df265e 2023-07-19 mark commit $(pop_id 5 $ids) [1/5]
449 c4df265e 2023-07-19 mark $ymd $(pop_id 5 $short_ids) flan_hacker commit 4
450 c4df265e 2023-07-19 mark $ymd $(pop_id 4 $short_ids) flan_hacker commit 3
451 c4df265e 2023-07-19 mark $ymd $(pop_id 3 $short_ids) flan_hacker commit 2
452 c4df265e 2023-07-19 mark $ymd $(pop_id 2 $short_ids) flan_hacker commit 1
453 c4df265e 2023-07-19 mark $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
454 c4df265e 2023-07-19 mark
455 c4df265e 2023-07-19 mark
456 c4df265e 2023-07-19 mark
457 c4df265e 2023-07-19 mark
458 c4df265e 2023-07-19 mark EOF
459 c4df265e 2023-07-19 mark
460 c4df265e 2023-07-19 mark got up -c:base:-6 > /dev/null
461 c4df265e 2023-07-19 mark ret=$?
462 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
463 c4df265e 2023-07-19 mark echo "got update failed unexpectedly"
464 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
465 c4df265e 2023-07-19 mark return 1
466 c4df265e 2023-07-19 mark fi
467 c4df265e 2023-07-19 mark
468 c4df265e 2023-07-19 mark tog log -c:base:+2
469 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
470 c4df265e 2023-07-19 mark ret=$?
471 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
472 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
473 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
474 c4df265e 2023-07-19 mark return 1
475 c4df265e 2023-07-19 mark fi
476 c4df265e 2023-07-19 mark
477 c4df265e 2023-07-19 mark cat <<-EOF >$testroot/view.expected
478 c4df265e 2023-07-19 mark commit $(pop_id 1 $ids) [1/1]
479 c4df265e 2023-07-19 mark $ymd $(pop_id 1 $short_ids) flan_hacker adding the test tree
480 c4df265e 2023-07-19 mark
481 c4df265e 2023-07-19 mark
482 c4df265e 2023-07-19 mark
483 c4df265e 2023-07-19 mark
484 c4df265e 2023-07-19 mark
485 c4df265e 2023-07-19 mark
486 c4df265e 2023-07-19 mark
487 c4df265e 2023-07-19 mark
488 c4df265e 2023-07-19 mark EOF
489 c4df265e 2023-07-19 mark
490 c4df265e 2023-07-19 mark tog log -c:base:-99
491 c4df265e 2023-07-19 mark cmp -s "$testroot/view.expected" "$testroot/view"
492 c4df265e 2023-07-19 mark ret=$?
493 c4df265e 2023-07-19 mark if [ $ret -ne 0 ]; then
494 c4df265e 2023-07-19 mark diff -u "$testroot/view.expected" "$testroot/view"
495 c4df265e 2023-07-19 mark test_done "$testroot" "$ret"
496 c4df265e 2023-07-19 mark return 1
497 c4df265e 2023-07-19 mark fi
498 c4df265e 2023-07-19 mark
499 af21bb7e 2023-04-12 mark test_done "$testroot" "$ret"
500 af21bb7e 2023-04-12 mark }
501 af21bb7e 2023-04-12 mark
502 af21bb7e 2023-04-12 mark test_parseargs "$@"
503 af21bb7e 2023-04-12 mark run_test test_log_hsplit_diff
504 af21bb7e 2023-04-12 mark run_test test_log_vsplit_diff
505 af21bb7e 2023-04-12 mark run_test test_log_show_author
506 af21bb7e 2023-04-12 mark run_test test_log_scroll_right
507 af21bb7e 2023-04-12 mark run_test test_log_hsplit_ref
508 af21bb7e 2023-04-12 mark run_test test_log_hsplit_tree
509 af21bb7e 2023-04-12 mark run_test test_log_logmsg_widechar
510 c4df265e 2023-07-19 mark run_test test_log_commit_keywords