From df35e84f162ad0165c8f2e579edaae72dcd2f2bc Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 17 Aug 2023 08:45:17 +0200 Subject: [PATCH 1/4] Update MSRV: 1.60.0 -> 1.63.0 We need to update the MSRV because the `rustix` dependency has this MSRV. Signed-off-by: Matthias Beyer --- .github/workflows/ci.yml | 6 +++--- README.md | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b4122bf..caa2ceee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ jobs: strategy: matrix: rust: - - 1.60.0 + - 1.63.0 - stable - beta steps: @@ -40,7 +40,7 @@ jobs: strategy: matrix: rust: - - 1.60.0 + - 1.63.0 - stable - beta # - nightly @@ -92,7 +92,7 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@master with: - toolchain: 1.60.0 + toolchain: 1.63.0 components: rustfmt - name: cargo-fmt run: cargo fmt -- --check diff --git a/README.md b/README.md index f322c44c..8f6d7ef4 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![crates.io](https://img.shields.io/crates/v/rexpect.svg)](https://crates.io/crates/rexpect) [![Released API docs](https://docs.rs/rexpect/badge.svg)](https://docs.rs/rexpect) [![Master API docs](https://img.shields.io/badge/docs-master-2f343b.svg)](http://philippkeller.github.io/rexpect) -[![MSRV](https://img.shields.io/badge/MSRV-1.60.0-blue)] +[![MSRV](https://img.shields.io/badge/MSRV-1.63.0-blue)] Spawn, control, and respond to expected patterns of child applications and processes, enabling the automation of interactions and testing. Components From 00f56bee3cdaaf39daf2b9cef2a01e23d61b02df Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Thu, 13 Apr 2023 17:16:15 +0200 Subject: [PATCH 2/4] Remove sporadicly failing test This is obviously not how it is done. This patch will be merged to master so that we can work on master without issues, but a PR will be filed to revert this patch immediately... with a fix, if someone can come up with one. Signed-off-by: Matthias Beyer --- src/session.rs | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/session.rs b/src/session.rs index d33d6a2a..467a5b9f 100644 --- a/src/session.rs +++ b/src/session.rs @@ -172,24 +172,6 @@ impl DerefMut for PtySession { } /// Start a process in a tty session, write and read from it -/// -/// # Example -/// -/// ``` -/// -/// use rexpect::spawn; -/// # use rexpect::error::Error; -/// -/// # fn main() { -/// # || -> Result<(), Error> { -/// let mut s = spawn("cat", Some(1000))?; -/// s.send_line("hello, polly!")?; -/// let line = s.read_line()?; -/// assert_eq!("hello, polly!", line); -/// # Ok(()) -/// # }().expect("test failed"); -/// # } -/// ``` impl PtySession { fn new(process: PtyProcess, timeout_ms: Option) -> Result { let f = process.get_file_handle()?; From 20edbbfe6987061f5a5e4da944921af73f5cc5a0 Mon Sep 17 00:00:00 2001 From: Petre Eftime Date: Wed, 23 Aug 2023 19:07:13 +0300 Subject: [PATCH 3/4] Revert "Remove sporadicly failing test" This reverts commit 00f56bee3cdaaf39daf2b9cef2a01e23d61b02df. --- src/session.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/session.rs b/src/session.rs index 467a5b9f..d33d6a2a 100644 --- a/src/session.rs +++ b/src/session.rs @@ -172,6 +172,24 @@ impl DerefMut for PtySession { } /// Start a process in a tty session, write and read from it +/// +/// # Example +/// +/// ``` +/// +/// use rexpect::spawn; +/// # use rexpect::error::Error; +/// +/// # fn main() { +/// # || -> Result<(), Error> { +/// let mut s = spawn("cat", Some(1000))?; +/// s.send_line("hello, polly!")?; +/// let line = s.read_line()?; +/// assert_eq!("hello, polly!", line); +/// # Ok(()) +/// # }().expect("test failed"); +/// # } +/// ``` impl PtySession { fn new(process: PtyProcess, timeout_ms: Option) -> Result { let f = process.get_file_handle()?; From e7848cc434ac838a73db4703d311f636fe374080 Mon Sep 17 00:00:00 2001 From: Petre Eftime Date: Wed, 23 Aug 2023 19:25:33 +0300 Subject: [PATCH 4/4] remove env stuff Signed-off-by: Petre Eftime --- src/session.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/session.rs b/src/session.rs index d33d6a2a..c3790ea7 100644 --- a/src/session.rs +++ b/src/session.rs @@ -380,9 +380,8 @@ pub fn spawn_bash(timeout: Option) -> Result { let mut rcfile = tempfile::NamedTempFile::new()?; let _ = rcfile.write( b"include () { [[ -f \"$1\" ]] && source \"$1\"; }\n\ - include /etc/bash.bashrc\n\ - include ~/.bashrc\n\ - PS1=\"~~~~\"\n\ + bind 'set enable-bracketed-paste off'\n + export PS1=\"~~~~\"\n\ unset PROMPT_COMMAND\n", )?; let mut c = Command::new("bash");