@@ -43,4 +43,77 @@ class VCSPackageTest extends AnyFunSuite with Matchers {
4343
4444 possibleCompareUrls(" https://scalacenter.github.io/scalafix/" , update) shouldBe List ()
4545 }
46+
47+ test(" possibleReleaseNoteFiles" ) {
48+ // blob/<branch>
49+ possibleReleaseNoteFiles(" https://github.com/foo/bar" , update) shouldBe List (
50+ " https://github.com/foo/bar/blob/master/CHANGELOG.md" ,
51+ " https://github.com/foo/bar/blob/master/CHANGELOG.markdown" ,
52+ " https://github.com/foo/bar/blob/master/CHANGELOG.rst" ,
53+ " https://github.com/foo/bar/blob/master/Changelog.md" ,
54+ " https://github.com/foo/bar/blob/master/Changelog.markdown" ,
55+ " https://github.com/foo/bar/blob/master/Changelog.rst" ,
56+ " https://github.com/foo/bar/blob/master/changelog.md" ,
57+ " https://github.com/foo/bar/blob/master/changelog.markdown" ,
58+ " https://github.com/foo/bar/blob/master/changelog.rst" ,
59+ " https://github.com/foo/bar/blob/master/RELEASES.md" ,
60+ " https://github.com/foo/bar/blob/master/RELEASES.markdown" ,
61+ " https://github.com/foo/bar/blob/master/RELEASES.rst" ,
62+ " https://github.com/foo/bar/blob/master/Releases.md" ,
63+ " https://github.com/foo/bar/blob/master/Releases.markdown" ,
64+ " https://github.com/foo/bar/blob/master/Releases.rst" ,
65+ " https://github.com/foo/bar/blob/master/releases.md" ,
66+ " https://github.com/foo/bar/blob/master/releases.markdown" ,
67+ " https://github.com/foo/bar/blob/master/releases.rst" ,
68+ " https://github.com/foo/bar/releases/tag/1.2.3" ,
69+ " https://github.com/foo/bar/releases/tag/v1.2.3"
70+ )
71+
72+ // blob/<branch>
73+ possibleReleaseNoteFiles(" https://gitlab.com/foo/bar" , update) shouldBe List (
74+ " https://gitlab.com/foo/bar/blob/master/CHANGELOG.md" ,
75+ " https://gitlab.com/foo/bar/blob/master/CHANGELOG.markdown" ,
76+ " https://gitlab.com/foo/bar/blob/master/CHANGELOG.rst" ,
77+ " https://gitlab.com/foo/bar/blob/master/Changelog.md" ,
78+ " https://gitlab.com/foo/bar/blob/master/Changelog.markdown" ,
79+ " https://gitlab.com/foo/bar/blob/master/Changelog.rst" ,
80+ " https://gitlab.com/foo/bar/blob/master/changelog.md" ,
81+ " https://gitlab.com/foo/bar/blob/master/changelog.markdown" ,
82+ " https://gitlab.com/foo/bar/blob/master/changelog.rst" ,
83+ " https://gitlab.com/foo/bar/blob/master/RELEASES.md" ,
84+ " https://gitlab.com/foo/bar/blob/master/RELEASES.markdown" ,
85+ " https://gitlab.com/foo/bar/blob/master/RELEASES.rst" ,
86+ " https://gitlab.com/foo/bar/blob/master/Releases.md" ,
87+ " https://gitlab.com/foo/bar/blob/master/Releases.markdown" ,
88+ " https://gitlab.com/foo/bar/blob/master/Releases.rst" ,
89+ " https://gitlab.com/foo/bar/blob/master/releases.md" ,
90+ " https://gitlab.com/foo/bar/blob/master/releases.markdown" ,
91+ " https://gitlab.com/foo/bar/blob/master/releases.rst"
92+ )
93+
94+ // just <branch>
95+ possibleReleaseNoteFiles(" https://bitbucket.org/foo/bar" , update) shouldBe List (
96+ " https://bitbucket.org/foo/bar/master/CHANGELOG.md" ,
97+ " https://bitbucket.org/foo/bar/master/CHANGELOG.markdown" ,
98+ " https://bitbucket.org/foo/bar/master/CHANGELOG.rst" ,
99+ " https://bitbucket.org/foo/bar/master/Changelog.md" ,
100+ " https://bitbucket.org/foo/bar/master/Changelog.markdown" ,
101+ " https://bitbucket.org/foo/bar/master/Changelog.rst" ,
102+ " https://bitbucket.org/foo/bar/master/changelog.md" ,
103+ " https://bitbucket.org/foo/bar/master/changelog.markdown" ,
104+ " https://bitbucket.org/foo/bar/master/changelog.rst" ,
105+ " https://bitbucket.org/foo/bar/master/RELEASES.md" ,
106+ " https://bitbucket.org/foo/bar/master/RELEASES.markdown" ,
107+ " https://bitbucket.org/foo/bar/master/RELEASES.rst" ,
108+ " https://bitbucket.org/foo/bar/master/Releases.md" ,
109+ " https://bitbucket.org/foo/bar/master/Releases.markdown" ,
110+ " https://bitbucket.org/foo/bar/master/Releases.rst" ,
111+ " https://bitbucket.org/foo/bar/master/releases.md" ,
112+ " https://bitbucket.org/foo/bar/master/releases.markdown" ,
113+ " https://bitbucket.org/foo/bar/master/releases.rst"
114+ )
115+
116+ // Empty for homepage
117+ possibleReleaseNoteFiles(" https://scalacenter.github.io/scalafix/" , update) shouldBe List ()
118+ }
46119}
0 commit comments