From ce1e181b4c6fbb88678bfa7da45b8a3da328ba2b Mon Sep 17 00:00:00 2001 From: "Jerome M. BERGER" Date: Tue, 22 May 2018 16:12:31 +0200 Subject: Make `crlf` match the default platform behaviour in `PopenSpawn`. Fixes #488 --- tests/test_popen_spawn.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/test_popen_spawn.py b/tests/test_popen_spawn.py index 98046ed..fca7493 100644 --- a/tests/test_popen_spawn.py +++ b/tests/test_popen_spawn.py @@ -125,6 +125,14 @@ class ExpectTestCase (PexpectTestCase.PexpectTestCase): p.expect_exact('def') p.expect(pexpect.EOF) + def test_crlf(self): + p = PopenSpawn('echo alpha beta') + assert p.read() == b'alpha beta' + p.crlf + + def test_crlf_encoding(self): + p = PopenSpawn('echo alpha beta', encoding='utf-8') + assert p.read() == 'alpha beta' + p.crlf + if __name__ == '__main__': unittest.main() -- cgit v1.2.1