chiark / gitweb /
test suite: gdr-new-upstream: Break out clog-check-[12]
[dgit.git] / tests / tests / gdr-newupstream
index 0724459ea8fc9a9dbfbc83eb61dcf50d45634ef6..b45a0bfe1ea8382161a589a96651910de20a46a7 100755 (executable)
@@ -26,8 +26,34 @@ t-git-debrebase new-upstream $v
 
 git tag v2.1 upstream
 
+git branch before-new-upstream
+
+clog-check-1 () {
+       before=$1
+       date=$(git log --format=%aD -n1 debian/changelog)
+       git show $before:debian/changelog >../clog.before
+       m="  * Update to new upstream version ${v%-*}."
+       e="dgit test git user <dgit-test@debian.example.net>  $date"
+}
+clog-check-2 () {
+       diff -u ../clog.expected debian/changelog
+}
+
+: ----- ordinary new upstream test -----
+
 t-git-debrebase new-upstream ${v%-*}
 
+clog-check-1 before-new-upstream
+cat - <<END ../clog.before >../clog.expected
+example ($v) UNRELEASED; urgency=medium
+
+$m
+
+ -- $e
+
+END
+clog-check-2
+
 t-gdr-good laundered
 git reflog | egrep 'debrebase new-upstream.*checkout'
 
@@ -36,9 +62,9 @@ t-gdr-good stitched
 
 git branch ordinary
 
-: 'with --anchor'
+: ----- 'with --anchor' -----
 
-git reset --hard startpoint
+git checkout -b with-anchor startpoint
 
 t-git-debrebase analyse >../anal.anch
 anchor=$(perl <../anal.anch -ne '