mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
lib/promrelabel: add tests for verifying that regex works as expected in single quotes and double quotes
This commit is contained in:
parent
3c22b5c41e
commit
92628f9f07
@ -859,6 +859,44 @@ func TestApplyRelabelConfigs(t *testing.T) {
|
||||
Value: "yyy",
|
||||
},
|
||||
})
|
||||
// regex in single quotes
|
||||
f(`
|
||||
- action: labeldrop
|
||||
regex: 'dropme'
|
||||
`, []prompbmarshal.Label{
|
||||
{
|
||||
Name: "xxx",
|
||||
Value: "yyy",
|
||||
},
|
||||
{
|
||||
Name: "dropme",
|
||||
Value: "aaa",
|
||||
},
|
||||
}, false, []prompbmarshal.Label{
|
||||
{
|
||||
Name: "xxx",
|
||||
Value: "yyy",
|
||||
},
|
||||
})
|
||||
// regex in double quotes
|
||||
f(`
|
||||
- action: labeldrop
|
||||
regex: "dropme"
|
||||
`, []prompbmarshal.Label{
|
||||
{
|
||||
Name: "xxx",
|
||||
Value: "yyy",
|
||||
},
|
||||
{
|
||||
Name: "dropme",
|
||||
Value: "aaa",
|
||||
},
|
||||
}, false, []prompbmarshal.Label{
|
||||
{
|
||||
Name: "xxx",
|
||||
Value: "yyy",
|
||||
},
|
||||
})
|
||||
})
|
||||
t.Run("labeldrop-prefix", func(t *testing.T) {
|
||||
f(`
|
||||
|
Loading…
Reference in New Issue
Block a user