Improve documentation of tests

This commit is contained in:
2023-02-07 05:30:10 +00:00
parent 162248cc3d
commit 77bf3a4a92

View File

@@ -12,6 +12,7 @@ func TestFilterBySuperPowers(t *testing.T) {
t.Errorf("Expected GetModuleRootPath to return module root path, got error: %v", err) t.Errorf("Expected GetModuleRootPath to return module root path, got error: %v", err)
return return
} }
persons, err := Load(rootPath + "/data/heros.json") persons, err := Load(rootPath + "/data/heros.json")
if err != nil { if err != nil {
t.Errorf("Expected Load to return persons, got error: %v", err) t.Errorf("Expected Load to return persons, got error: %v", err)
@@ -27,6 +28,7 @@ func TestFilterBySuperPowers(t *testing.T) {
if len(SearchByPowers(persons, []string{"healing"})) < 1 { if len(SearchByPowers(persons, []string{"healing"})) < 1 {
t.Errorf("Expected at least one person with healing superpower, got none") t.Errorf("Expected at least one person with healing superpower, got none")
} }
// Test with valid and invalid // Test with valid and invalid
if len(SearchByPowers(persons, []string{"healing", "slowpoking"})) < 1 { if len(SearchByPowers(persons, []string{"healing", "slowpoking"})) < 1 {
t.Errorf("Expected at least one person with healing superpower, got none") t.Errorf("Expected at least one person with healing superpower, got none")