@@ -103,7 +103,7 @@ index cff484d..9f67763 100644
103103 assert .Equal (t , "submission" , requestType , testName )
104104 assert .Equal (t , "" , requestError , testName )
105105 assert .Equal (t , "submit" , arduinoLintLibraryManagerSetting , testName )
106- assert .ElementsMatch (t , submissionURLs , []string {"https://github.com/foo/bar" , "https://github.com/foo/baz" }, testName )
106+ assert .ElementsMatch (t , []string {"https://github.com/foo/bar" , "https://github.com/foo/baz" }, submissionURLs , testName )
107107
108108 testName = "Submission w/ no newline at end of file"
109109 diff = []byte (`
@@ -137,7 +137,7 @@ index cff484d..1b0b80b 100644
137137 assert .Equal (t , "submission" , requestType , testName )
138138 assert .Equal (t , "" , requestError , testName )
139139 assert .Equal (t , "submit" , arduinoLintLibraryManagerSetting , testName )
140- assert .ElementsMatch (t , submissionURLs , []string {"https://github.com/foo/bar" }, testName )
140+ assert .ElementsMatch (t , []string {"https://github.com/foo/bar" }, submissionURLs , testName )
141141
142142 testName = "Removal"
143143 diff = []byte (`
@@ -170,7 +170,27 @@ index cff484d..8b401a1 100644
170170 assert .Equal (t , "modification" , requestType , testName )
171171 assert .Equal (t , "" , requestError , testName )
172172 assert .Equal (t , "update" , arduinoLintLibraryManagerSetting , testName )
173- assert .Equal (t , submissionURLs , []string {"https://github.com/foo/bar" }, testName )
173+ assert .Equal (t , []string {"https://github.com/foo/bar" }, submissionURLs , testName )
174+
175+ testName = "Newline-only"
176+ diff = []byte (`
177+ diff --git a/repositories.txt b/repositories.txt
178+ index d9a6136..ca902d9 100644
179+ --- a/repositories.txt
180+ +++ b/repositories.txt
181+ @@ -1,4 +1,4 @@
182+ https://github.com/firmata/arduino
183+ -
184+ https://github.com/arduino-libraries/Ethernet
185+ https://github.com/lbernstone/plotutils
186+ +
187+ ` )
188+
189+ requestType , requestError , arduinoLintLibraryManagerSetting , submissionURLs = parseDiff (diff , "repositories.txt" )
190+ assert .Equal (t , "other" , requestType , testName )
191+ assert .Equal (t , "" , requestError , testName )
192+ assert .Equal (t , "" , arduinoLintLibraryManagerSetting , testName )
193+ assert .Nil (t , submissionURLs , testName )
174194}
175195
176196func Test_normalizeURL (t * testing.T ) {
0 commit comments