8// Cognitive global enabled and returns the resulting FileJob so callers can
9// assert on both Complexity and Cognitive.
10▶func countCognitive(t *testing.T, language, content string) FileJob {
11 t.Helper()
12 ProcessConstants()
· · ·
21// on, so callers can assert on the CognitiveLine array as well as the whole-file
22// tally.
23▶func countCognitiveLines(t *testing.T, language, content string) FileJob {
24 t.Helper()
25 ProcessConstants()
· · ·
31}
32
33▶func sumInt64(xs []int64) int64 {
34 var total int64
35 for _, x := range xs {
· · ·
41// The per-line array must total to the whole-file Cognitive value, for flat and
42// nested files alike.
43▶func TestCognitiveLineSumEqualsCognitive(t *testing.T) {
44 Cognitive = true
45 defer func() { Cognitive = false }()
· · ·
45▶ defer func() { Cognitive = false }()
46
47 cases := map[string]string{
+ 34 more matches in this file