add multiline redactor test

This commit is contained in:
Andrew Lavery
2020-04-27 20:52:01 -04:00
parent 56150c3345
commit 2f092ae4a1
+35
View File
@@ -202,6 +202,41 @@ another line here`,
want: map[string]string{
"data/datacollectorname": `abc 123
another line here
`,
},
},
{
name: "custom multiline redactor",
Collect: &troubleshootv1beta1.Collect{
Data: &troubleshootv1beta1.Data{
CollectorMeta: troubleshootv1beta1.CollectorMeta{
CollectorName: "datacollectorname",
Exclude: multitype.BoolOrString{},
},
Name: "data",
Data: `xyz123
abc
xyz123
xyz123
abc`,
},
},
Redactors: []*troubleshootv1beta1.Redact{
{
MultiLine: []troubleshootv1beta1.MultiLine{
{
Selector: "abc",
Redactor: "xyz(123)",
},
},
},
},
want: map[string]string{
"data/datacollectorname": `xyz123
abc
123
xyz123
abc
`,
},
},