summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Eßer <se@FreeBSD.org>2021-09-22 14:57:11 +0200
committerStefan Eßer <se@FreeBSD.org>2021-09-22 14:57:11 +0200
commitb3a11ac3dba190dce355620935ef45260d6e721e (patch)
tree86710d3a1730b2a0525b834cfe69fa67c1b5d867
parent2be6c4d1aa2b9b522636342c2fd54b73c058060d (diff)
downloadpexpect-b3a11ac3dba190dce355620935ef45260d6e721e.tar.gz
Use only POSIX commands and options
The hard-coded use of /bin/bash and of long options for nl does only work on Linux based systems with GNU textutils. If POSIX commands and options are used, this test becomes portable to other systems than Linux.
-rwxr-xr-xtests/test_expect.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_expect.py b/tests/test_expect.py
index c37e159..243bc34 100755
--- a/tests/test_expect.py
+++ b/tests/test_expect.py
@@ -411,7 +411,7 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase):
def test_before_across_chunks(self):
# https://github.com/pexpect/pexpect/issues/478
child = pexpect.spawn(
- '''/bin/bash -c "openssl rand -base64 {} 2>/dev/null | head -500 | nl --number-format=rz --number-width=5 2>&1 ; echo 'PATTERN!!!'"'''.format(1024 * 1024 * 2),
+ '''/bin/sh -c "openssl rand -base64 {} 2>/dev/null | head -500 | nl -n rz -w 5 2>&1 ; echo 'PATTERN!!!'"'''.format(1024 * 1024 * 2),
searchwindowsize=128
)
child.expect(['PATTERN'])