@@ -103,7 +103,7 @@ index cff484d..9f67763 100644
103
103
assert .Equal (t , "submission" , requestType , testName )
104
104
assert .Equal (t , "" , requestError , testName )
105
105
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 )
107
107
108
108
testName = "Submission w/ no newline at end of file"
109
109
diff = []byte (`
@@ -137,7 +137,7 @@ index cff484d..1b0b80b 100644
137
137
assert .Equal (t , "submission" , requestType , testName )
138
138
assert .Equal (t , "" , requestError , testName )
139
139
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 )
141
141
142
142
testName = "Removal"
143
143
diff = []byte (`
@@ -170,7 +170,27 @@ index cff484d..8b401a1 100644
170
170
assert .Equal (t , "modification" , requestType , testName )
171
171
assert .Equal (t , "" , requestError , testName )
172
172
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 )
174
194
}
175
195
176
196
func Test_normalizeURL (t * testing.T ) {
0 commit comments