@@ -199,6 +199,30 @@ func testGroupParseGroupsMultipleGroups(t *testing.T) {
199199}
200200
201201func testGroupParseGroupsBreakingSign (t * testing.T ) {
202+ t .Run ("NoScope" , testGroupParseGroupsBreakingSignNoScope )
203+ t .Run ("BeforeScope" , testGroupParseGroupsBreakingSignBeforeScope )
204+ t .Run ("AfterScope" , testGroupParseGroupsBreakingSignAfterScope )
205+ }
206+
207+ func testGroupParseGroupsBreakingSignNoScope (t * testing.T ) {
208+ t .Parallel ()
209+ logs := []string {
210+ "ref: nothing important" ,
211+ "ref!: this is a test" ,
212+ }
213+ got := commit .ParseGroups (logs )
214+
215+ want := strings .Join ([]string {
216+ "### Refactor\n " ,
217+ "- Nothing important" ,
218+ "- This is a test [**BREAKING CHANGE**]" ,
219+ }, "\n " )
220+ if diff := cmp .Diff (want , got ); diff != "" {
221+ t .Errorf ("(-want +got):\n %s" , diff )
222+ }
223+ }
224+
225+ func testGroupParseGroupsBreakingSignBeforeScope (t * testing.T ) {
202226 t .Parallel ()
203227 logs := []string {
204228 "ref: nothing important" ,
@@ -216,6 +240,24 @@ func testGroupParseGroupsBreakingSign(t *testing.T) {
216240 }
217241}
218242
243+ func testGroupParseGroupsBreakingSignAfterScope (t * testing.T ) {
244+ t .Parallel ()
245+ logs := []string {
246+ "ref: nothing important" ,
247+ "ref(repo)!: this is a test" ,
248+ }
249+ got := commit .ParseGroups (logs )
250+
251+ want := strings .Join ([]string {
252+ "### Refactor\n " ,
253+ "- Nothing important" ,
254+ "- **Repo:** This is a test [**BREAKING CHANGE**]" ,
255+ }, "\n " )
256+ if diff := cmp .Diff (want , got ); diff != "" {
257+ t .Errorf ("(-want +got):\n %s" , diff )
258+ }
259+ }
260+
219261func testGroupParseGroupsBreakingFooter (t * testing.T ) {
220262 t .Parallel ()
221263 logs := []string {
0 commit comments