|
@@ -96,6 +96,7 @@ func TestParse(t *testing.T) {
|
96
|
96
|
{"peek=line.*01", "cpu"},
|
97
|
97
|
{"weblist=line[13],addresses,flat", "cpu"},
|
98
|
98
|
{"tags,tagfocus=400kb:", "heap_request"},
|
|
99
|
+ {"tags,tagfocus=+400kb:", "heap_request"},
|
99
|
100
|
{"dot", "longNameFuncs"},
|
100
|
101
|
{"text", "longNameFuncs"},
|
101
|
102
|
}
|
|
@@ -1440,6 +1441,20 @@ func TestNumericTagFilter(t *testing.T) {
|
1440
|
1441
|
map[string]string{"key1": "bytes"},
|
1441
|
1442
|
false,
|
1442
|
1443
|
},
|
|
1444
|
+ {
|
|
1445
|
+ "Match negative key and range of values, value matches",
|
|
1446
|
+ "bytes=-512b:-128b",
|
|
1447
|
+ map[string][]int64{"bytes": {-256}},
|
|
1448
|
+ map[string]string{"bytes": "bytes"},
|
|
1449
|
+ true,
|
|
1450
|
+ },
|
|
1451
|
+ {
|
|
1452
|
+ "Match negative key and range of values, value outside range",
|
|
1453
|
+ "bytes=-512b:-128b",
|
|
1454
|
+ map[string][]int64{"bytes": {-2048}},
|
|
1455
|
+ map[string]string{"bytes": "bytes"},
|
|
1456
|
+ false,
|
|
1457
|
+ },
|
1443
|
1458
|
}
|
1444
|
1459
|
for _, test := range tagFilterTests {
|
1445
|
1460
|
t.Run(test.desc, func(*testing.T) {
|