Skip to content

Commit df4e2dd

Browse files
committed
Change bless to clean up absolute paths
With the change to php_verror, it now prints the arguments to the function. The strings in an argument can have absolute paths, and containing user-specific things like a home directory isn't very good for unit tests. Try to cut that out as much as possible.
1 parent 6819ad9 commit df4e2dd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

scripts/dev/bless_tests.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ function normalizeOutput(string $out): string {
7474
'Resource ID#%d used as offset, casting to integer (%d)',
7575
$out);
7676
$out = preg_replace('/string\(\d+\) "([^"]*%d)/', 'string(%d) "$1', $out);
77+
// Inside of strings, replace absolute paths that have been truncated with
78+
// any string. These tend to contain homedirs with usernames, not good.
79+
$out = preg_replace("/'\\/.*\.\\.\\.'/", "'%s'", $out);
7780
$out = str_replace("\0", '%0', $out);
7881
return $out;
7982
}

0 commit comments

Comments
 (0)