Commit b61dfbeb authored by Chip Turner's avatar Chip Turner Committed by Dave Watson

Fix incorrect 'test' statement in unit test

Summary:
The 'test' command uses one equal sign for string equality, not
two.  bash apparently is okay with two, but zsh isn't, causing this test
to pass if your shell was bash and fail if it was zsh.  The test now
passes with bash, bash in sh mode, zsh, and even dash.

Test Plan:
runtests, also, these pass (zsh failed before):

SHELL=/bin/bash _build/dbg/folly/test/subprocess_test
SHELL=/bin/sh _build/dbg/folly/test/subprocess_test
SHELL=/bin/zsh _build/dbg/folly/test/subprocess_test
SHELL=/bin/dash _build/dbg/folly/test/subprocess_test

Reviewed By: njormrod@fb.com

Subscribers: lins, anca, folly-diffs@

FB internal diff: D1756090

Signature: t1:1756090:1419360674:8576e61a6e0ee102612c5eae0e1fbd79cc397bfa
parent 2799131d
......@@ -257,7 +257,7 @@ TEST(CommunicateSubprocessTest, Duplex) {
}
TEST(CommunicateSubprocessTest, ProcessGroupLeader) {
const auto testIsLeader = "test $(cut -d ' ' -f 5 /proc/$$/stat) == $$";
const auto testIsLeader = "test $(cut -d ' ' -f 5 /proc/$$/stat) = $$";
Subprocess nonLeader(testIsLeader);
EXPECT_THROW(nonLeader.waitChecked(), CalledProcessError);
Subprocess leader(testIsLeader, Subprocess::Options().processGroupLeader());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment