Skip to content

Commit 87e7685

Browse files
committed
Fix posix getpwnum/getpwuid tests with empty passwd
On Linux passwd is "x", on FreeBSD it is just "". Also switch the test to use EXPECTF, I don't see a reason why it should use EXPECTREGEX.
1 parent db1bde7 commit 87e7685

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

ext/posix/tests/posix_getpwnam_basic_01.phpt

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ User Group: PHPSP #phptestfestbrasil
1717
var_dump($username == $info['name']);
1818
?>
1919
===DONE====
20-
--EXPECTREGEX--
20+
--EXPECTF--
2121
Array
22-
\(
23-
\[name\] => [^\r\n]+
24-
\[passwd\] => [^\r\n]+
25-
\[uid\] => [0-9]+
26-
\[gid\] => [0-9]+
27-
\[gecos\] => [^\r\n]*
28-
\[dir\] => [^\r\n]+
29-
\[shell\] => [^\r\n]+
30-
\)
31-
bool\(true\)
22+
(
23+
[name] => %s
24+
[passwd] => %S
25+
[uid] => %d
26+
[gid] => %d
27+
[gecos] => %S
28+
[dir] => %s
29+
[shell] => %s
30+
)
31+
bool(true)
3232
===DONE====

ext/posix/tests/posix_getpwuid_basic.phpt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ Test posix_getpwuid() function : basic functionality
1515

1616
?>
1717
===DONE====
18-
--EXPECTREGEX--
18+
--EXPECTF--
1919
Basic test of POSIX getpwuid
2020
Array
21-
\(
22-
\[name\] => [^\r\n]+
23-
\[passwd\] => [^\r\n]+
24-
\[uid\] => [0-9]+
25-
\[gid\] => [0-9]+
26-
\[gecos\] => [^\r\n]*
27-
\[dir\] => [^\r\n]+
28-
\[shell\] => [^\r\n]+
29-
\)
21+
(
22+
[name] => %s
23+
[passwd] => %S
24+
[uid] => %d
25+
[gid] => %d
26+
[gecos] => %S
27+
[dir] => %s
28+
[shell] => %s
29+
)
3030
===DONE====

0 commit comments

Comments
 (0)