Skip to content

Commit

Permalink
Update to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed Jan 14, 2019
1 parent 856025f commit bc0d05e
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions processor/formatters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,36 @@ func TestFileSummarizeShort(t *testing.T) {
}
}

func TestFileSummarizeShortSort(t *testing.T) {
inputChan := make(chan *FileJob, 1000)
inputChan <- &FileJob{
Language: "Go",
Filename: "bbbb.go",
Extension: "go",
Location: "./",
Bytes: 1000,
Lines: 1000,
Code: 1000,
Comment: 1000,
Blank: 1000,
Complexity: 1000,
WeightedComplexity: 1000,
Binary: false,
}
close(inputChan)

sortBy := []string{"name", "line", "blank", "code", "comment"}

for _, sort := range sortBy {
SortBy = sort
res := fileSummarizeShort(inputChan)

if !strings.Contains(res, `Language`) {
t.Error("Expected Summary return", res)
}
}
}

// When using columise ~28726 ns/op
// When using optimised ~14293 ns/op
func BenchmarkFileSummerize(b *testing.B) {
Expand Down

0 comments on commit bc0d05e

Please sign in to comment.