|
@@ -591,10 +591,31 @@ func TestFilter(t *testing.T) {
|
591
|
591
|
}
|
592
|
592
|
|
593
|
593
|
for tx, tc := range []filterTestcase{
|
594
|
|
- {nil, nil, nil, nil, true, false, false, false},
|
595
|
|
- {regexp.MustCompile("notfound"), nil, nil, nil, false, false, false, false},
|
596
|
|
- {nil, regexp.MustCompile("foo.c"), nil, nil, true, true, false, false},
|
597
|
|
- {nil, nil, regexp.MustCompile("lib.so"), nil, true, false, true, false},
|
|
594
|
+ {
|
|
595
|
+ fm: true, // nil focus matches every sample
|
|
596
|
+ },
|
|
597
|
+ {
|
|
598
|
+ focus: regexp.MustCompile("notfound"),
|
|
599
|
+ },
|
|
600
|
+ {
|
|
601
|
+ ignore: regexp.MustCompile("foo.c"),
|
|
602
|
+ fm: true,
|
|
603
|
+ im: true,
|
|
604
|
+ },
|
|
605
|
+ {
|
|
606
|
+ hide: regexp.MustCompile("lib.so"),
|
|
607
|
+ fm: true,
|
|
608
|
+ hm: true,
|
|
609
|
+ },
|
|
610
|
+ {
|
|
611
|
+ show: regexp.MustCompile("foo.c"),
|
|
612
|
+ fm: true,
|
|
613
|
+ hnm: true,
|
|
614
|
+ },
|
|
615
|
+ {
|
|
616
|
+ show: regexp.MustCompile("notfound"),
|
|
617
|
+ fm: true,
|
|
618
|
+ },
|
598
|
619
|
} {
|
599
|
620
|
prof := *testProfile1.Copy()
|
600
|
621
|
gf, gi, gh, gnh := prof.FilterSamplesByName(tc.focus, tc.ignore, tc.hide, tc.show)
|