-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a parser bug for Unreleased entries
- Loading branch information
Showing
5 changed files
with
107 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,26 @@ | ||
package parser_test | ||
|
||
// TODO: Write tests for parser.go | ||
import ( | ||
"testing" | ||
|
||
"github.com/chelnak/gh-changelog/pkg/parser" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestParser(t *testing.T) { | ||
t.Run("can parse a changelog with an unreleased section", func(t *testing.T) { | ||
p := parser.NewParser("./testdata/unreleased.md", "chelnak", "gh-changelog") | ||
c, err := p.Parse() | ||
require.NoError(t, err) | ||
require.Len(t, c.GetUnreleased(), 2) | ||
require.Len(t, c.GetEntries(), 3) | ||
}) | ||
|
||
t.Run("can parse a changelog without an unreleased section", func(t *testing.T) { | ||
p := parser.NewParser("./testdata/no_unreleased.md", "chelnak", "gh-changelog") | ||
c, err := p.Parse() | ||
require.NoError(t, err) | ||
require.Len(t, c.GetUnreleased(), 0) | ||
require.Len(t, c.GetEntries(), 3) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<!-- markdownlint-disable MD024 --> | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). | ||
|
||
## [v0.15.1](https://github.com/chelnak/gh-changelog/tree/v0.15.1) - 2023-10-09 | ||
|
||
[Full Changelog](https://github.com/chelnak/gh-changelog/compare/v0.15.0...v0.15.1) | ||
|
||
### Fixed | ||
|
||
- bugfix: Release creation toggling RepoName & RepoOwner [#142](https://github.com/chelnak/gh-changelog/pull/142) ([Ramesh7](https://github.com/Ramesh7)) | ||
|
||
## [v0.15.0](https://github.com/chelnak/gh-changelog/tree/v0.15.0) - 2023-10-01 | ||
|
||
[Full Changelog](https://github.com/chelnak/gh-changelog/compare/v0.14.0...v0.15.0) | ||
|
||
### Added | ||
|
||
- Improve sections ordering [#139](https://github.com/chelnak/gh-changelog/pull/139) ([smortex](https://github.com/smortex)) | ||
|
||
## [v0.1.0](https://github.com/chelnak/gh-changelog/tree/v0.1.0) - 2022-04-15 | ||
|
||
[Full Changelog](https://github.com/chelnak/gh-changelog/compare/42d4c93b23eaf307c5f9712f4c62014fe38332bd...v0.1.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<!-- markdownlint-disable MD024 --> | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org). | ||
|
||
## Unreleased | ||
|
||
- Fix no previous tag when using get cmd [#148](https://github.com/chelnak/gh-changelog/pull/148) ([h0tw1r3](https://github.com/h0tw1r3)) | ||
- Add missing line between "Changed" title and list [#146](https://github.com/chelnak/gh-changelog/pull/146) ([smortex](https://github.com/smortex)) | ||
|
||
## [v0.15.1](https://github.com/chelnak/gh-changelog/tree/v0.15.1) - 2023-10-09 | ||
|
||
[Full Changelog](https://github.com/chelnak/gh-changelog/compare/v0.15.0...v0.15.1) | ||
|
||
### Fixed | ||
|
||
- bugfix: Release creation toggling RepoName & RepoOwner [#142](https://github.com/chelnak/gh-changelog/pull/142) ([Ramesh7](https://github.com/Ramesh7)) | ||
|
||
## [v0.15.0](https://github.com/chelnak/gh-changelog/tree/v0.15.0) - 2023-10-01 | ||
|
||
[Full Changelog](https://github.com/chelnak/gh-changelog/compare/v0.14.0...v0.15.0) | ||
|
||
### Added | ||
|
||
- Improve sections ordering [#139](https://github.com/chelnak/gh-changelog/pull/139) ([smortex](https://github.com/smortex)) | ||
|
||
## [v0.1.0](https://github.com/chelnak/gh-changelog/tree/v0.1.0) - 2022-04-15 | ||
|
||
[Full Changelog](https://github.com/chelnak/gh-changelog/compare/42d4c93b23eaf307c5f9712f4c62014fe38332bd...v0.1.0) |