[PATCH 3 of 3] Add more tests for formatting and merging of release notes

Rishabh Madan rishabhmadan96 at gmail.com
Sat Jun 3 18:28:16 EDT 2017


# HG changeset patch
# User Rishabh Madan <rishabhmadan96 at gmail.com>
# Date 1496528205 -7200
#      Sun Jun 04 00:16:45 2017 +0200
# Node ID 5154239fff11aacb065f4de8081884bfba691eed
# Parent  dfc1e6491b96127ae64504e8dad6cac037b80b6a
Add more tests for formatting and merging of release notes

diff -r dfc1e6491b96 -r 5154239fff11 tests/test-releasenotes-formatting.t
--- a/tests/test-releasenotes-formatting.t	Sat Jun 03 22:37:44 2017 +0200
+++ b/tests/test-releasenotes-formatting.t	Sun Jun 04 00:16:45 2017 +0200
@@ -254,3 +254,73 @@
   -------------
   
   * Short summary of fix 3
+
+Multiple 'Other Changes' sub-sections for every section
+
+  $ hg init multiple-otherchanges
+  $ cd multiple-otherchanges
+
+  $ touch fix1
+  $ hg -q commit -A -l - << EOF
+  > commit 1
+  > 
+  > .. fix:: Title of First Fix
+  > 
+  >    First paragraph of fix 1.
+  > EOF
+
+  $ touch feature1
+  $ hg -q commit -A -l - << EOF
+  > commit 2
+  > 
+  > .. feature:: Title of First Feature
+  > 
+  >    First paragraph of feature 1.
+  > EOF
+
+  $ touch feature2
+  $ hg -q commit -A -l - << EOF
+  > commit 3
+  > 
+  > .. feature::
+  > 
+  >    Short summary of feature 2.
+  > EOF
+
+  $ touch fix2
+  $ hg -q commit -A -l - << EOF
+  > commit 4
+  > 
+  > .. fix::
+  > 
+  >    Short summary of fix 2
+  > EOF
+
+  $ hg releasenotes -r 'all()' $TESTTMP/relnotes-multiple-otherchanges
+  $ cat $TESTTMP/relnotes-multiple-otherchanges
+  New Features
+  ============
+  
+  Title of First Feature
+  ----------------------
+  
+  First paragraph of feature 1.
+  
+  Other Changes
+  -------------
+  
+  * Short summary of feature 2.
+  
+  Bug Fixes
+  =========
+  
+  Title of First Fix
+  ------------------
+  
+  First paragraph of fix 1.
+  
+  Other Changes
+  -------------
+  
+  * Short summary of fix 2
+
diff -r dfc1e6491b96 -r 5154239fff11 tests/test-releasenotes-merging.t
--- a/tests/test-releasenotes-merging.t	Sat Jun 03 22:37:44 2017 +0200
+++ b/tests/test-releasenotes-merging.t	Sun Jun 04 00:16:45 2017 +0200
@@ -110,3 +110,54 @@
   This describes a feature from a commit message.
 
   $ cd ..
+
+Bullets don't merge properly
+
+  $ hg init bullets
+  $ cd bullets
+  $ touch fix1
+  $ hg -q commit -A -l - << EOF
+  > commit 1
+  > 
+  > .. fix::
+  > 
+  >    this is fix1.
+  > EOF
+
+  $ touch fix2
+  $ hg -q commit -A -l - << EOF
+  > commit 2
+  > 
+  > .. fix::
+  > 
+  >    this is fix2.
+  > EOF
+
+  $ hg releasenotes -r 'all()' $TESTTMP/relnotes-bullet-problem
+  $ cat $TESTTMP/relnotes-bullet-problem
+  Bug Fixes
+  =========
+  
+  * this is fix1.
+  
+  * this is fix2.
+  $ touch fix3
+  $ hg -q commit -A -l - << EOF
+  > commit 3
+  > 
+  > .. fix::
+  > 
+  >    this is fix3.
+  > EOF
+
+  $ hg releasenotes -r . $TESTTMP/relnotes-bullet-problem
+  $ cat $TESTTMP/relnotes-bullet-problem
+  Bug Fixes
+  =========
+  
+  * this is fix1.
+  
+    this is fix2.
+  
+  * this is fix3.
+


More information about the Mercurial-devel mailing list