Skip to content

Commit 401f029

Browse files
committed
Add missing tests for library check functions
1 parent 090caf8 commit 401f029

File tree

7 files changed

+51
-0
lines changed

7 files changed

+51
-0
lines changed

Diff for: check/checkfunctions/library_test.go

+23
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,17 @@ func TestLibraryPropertiesParagraphFieldSpellCheck(t *testing.T) {
283283
checkLibraryCheckFunction(LibraryPropertiesParagraphFieldSpellCheck, testTables, t)
284284
}
285285

286+
func TestLibraryPropertiesEmailFieldAsMaintainerAlias(t *testing.T) {
287+
testTables := []libraryCheckFunctionTestTable{
288+
{"Unable to load", "InvalidLibraryProperties", checkresult.NotRun, ""},
289+
{"No email field", "MissingFields", checkresult.Skip, ""},
290+
{"email in place of maintainer", "EmailOnly", checkresult.Fail, ""},
291+
{"email and maintainer", "EmailAndMaintainer", checkresult.Pass, ""},
292+
}
293+
294+
checkLibraryCheckFunction(LibraryPropertiesEmailFieldAsMaintainerAlias, testTables, t)
295+
}
296+
286297
func TestLibraryPropertiesParagraphFieldRepeatsSentence(t *testing.T) {
287298
testTables := []libraryCheckFunctionTestTable{
288299
{"Unable to load", "InvalidLibraryProperties", checkresult.NotRun, ""},
@@ -292,6 +303,18 @@ func TestLibraryPropertiesParagraphFieldRepeatsSentence(t *testing.T) {
292303

293304
checkLibraryCheckFunction(LibraryPropertiesParagraphFieldRepeatsSentence, testTables, t)
294305
}
306+
307+
func TestLibraryPropertiesCategoryFieldUncategorized(t *testing.T) {
308+
testTables := []libraryCheckFunctionTestTable{
309+
{"Unable to load", "InvalidLibraryProperties", checkresult.NotRun, ""},
310+
{"No category field", "MissingFields", checkresult.Skip, ""},
311+
{"Uncategorized category", "UncategorizedCategoryValue", checkresult.Fail, ""},
312+
{"Valid category value", "Recursive", checkresult.Pass, ""},
313+
}
314+
315+
checkLibraryCheckFunction(LibraryPropertiesCategoryFieldUncategorized, testTables, t)
316+
}
317+
295318
func TestLibraryPropertiesUrlFieldDeadLink(t *testing.T) {
296319
testTables := []libraryCheckFunctionTestTable{
297320
{"Unable to load", "InvalidLibraryProperties", checkresult.NotRun, ""},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name=EmailAndMaintainer
2+
version=1.0.0
3+
author=Cristian Maglie <[email protected]>, Pippo Pluto <[email protected]>
4+
maintainer=Cristian Maglie <[email protected]>
5+
email=Cristian Maglie <[email protected]>
6+
sentence=A library that makes coding a web server a breeze.
7+
paragraph=Supports HTTP1.1 and you can do GET and POST.
8+
category=Communication
9+
url=http://example.com/
10+
architectures=avr

Diff for: check/checkfunctions/testdata/libraries/EmailAndMaintainer/src/EmailAndMaintainer.h

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=EmailOnly
2+
version=1.0.0
3+
author=Cristian Maglie <[email protected]>, Pippo Pluto <[email protected]>
4+
email=Cristian Maglie <[email protected]>
5+
sentence=A library that makes coding a web server a breeze.
6+
paragraph=Supports HTTP1.1 and you can do GET and POST.
7+
category=Communication
8+
url=http://example.com/
9+
architectures=avr

Diff for: check/checkfunctions/testdata/libraries/EmailOnly/src/EmailOnly.h

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
name=UncategorizedCategoryValue
2+
version=1.0.0
3+
author=Cristian Maglie <[email protected]>, Pippo Pluto <[email protected]>
4+
maintainer=Cristian Maglie <[email protected]>
5+
sentence=A library that makes coding a web server a breeze.
6+
paragraph=Supports HTTP1.1 and you can do GET and POST.
7+
category=Uncategorized
8+
url=http://example.com/
9+
architectures=avr

Diff for: check/checkfunctions/testdata/libraries/UncategorizedCategoryValue/src/UncategorizedCategoryValue.h

Whitespace-only changes.

0 commit comments

Comments
 (0)