sampleFuncs returns a slice of strings where each string represents one profile sample in the format " : ". This allows the expected values for test cases to be specified in human-readable strings.
(p *Profile)
| 543 | // the expected values for test cases to be specified in human-readable |
| 544 | // strings. |
| 545 | func sampleFuncs(p *Profile) []string { |
| 546 | var ret []string |
| 547 | for _, s := range p.Sample { |
| 548 | var funcs []string |
| 549 | for _, loc := range s.Location { |
| 550 | for _, line := range loc.Line { |
| 551 | funcs = append(funcs, line.Function.Name) |
| 552 | } |
| 553 | } |
| 554 | ret = append(ret, fmt.Sprintf("%s: %d", strings.Join(funcs, " "), s.Value[0])) |
| 555 | } |
| 556 | return ret |
| 557 | } |
| 558 | |
| 559 | func TestTagFilter(t *testing.T) { |
| 560 | // Perform several forms of tag filtering on the test profile. |
no outgoing calls
no test coverage detected
searching dependent graphs…