mirror of
https://github.com/rancher/norman.git
synced 2025-07-03 02:27:27 +00:00
20 lines
425 B
Go
20 lines
425 B
Go
|
package condition
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func TestRegexp(t *testing.T) {
|
||
|
testInputs := []string{
|
||
|
"create file /tmp/file-uy76324 ",
|
||
|
"/tmp/file-y6123tsd",
|
||
|
}
|
||
|
testOutputs := []string{
|
||
|
"create file file_path_redacted ",
|
||
|
"file_path_redacted",
|
||
|
}
|
||
|
for i, s := range testInputs {
|
||
|
if testOutputs[i] != temfileRegexp.ReplaceAllString(s, "file_path_redacted") {
|
||
|
t.Fatalf("Regexp failed to check %s", testInputs[i])
|
||
|
}
|
||
|
}
|
||
|
}
|