Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check_eof test fails on macOS #51

Closed
james-chf opened this issue Oct 28, 2022 · 3 comments
Closed

check_eof test fails on macOS #51

james-chf opened this issue Oct 28, 2022 · 3 comments

Comments

@james-chf
Copy link
Contributor

On the latest commit at the time of writing

expectrl/tests/check.rs

Lines 87 to 106 in cbd0114

#[cfg(unix)]
#[cfg(not(feature = "async"))]
#[test]
fn check_eof() {
let mut session = spawn("echo 'Hello World'").unwrap();
thread::sleep(Duration::from_millis(600));
let m = session.check(Eof).unwrap();
assert_eq!(m.before(), b"");
#[cfg(target_os = "linux")]
assert_eq!(m.get(0).unwrap(), b"'Hello World'\r\n");
#[cfg(not(target_os = "linux"))]
{
if m.matches().len() > 0 {
assert_eq!(m.get(0).unwrap(), b"'Hello World'\r\n");
}
}
}

To reproduce:

cargo test check_eof -- --exact

Test output on macOS 13 with zsh

running 1 test
test check_eof ... FAILED

failures:

---- check_eof stdout ----
thread 'check_eof' panicked at 'assertion failed: `(left == right)`
  left: `[]`,
 right: `[39, 72, 101, 108, 108, 111, 32, 87, 111, 114, 108, 100, 39, 13, 10]`', tests/check.rs:103:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    check_eof

test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 9 filtered out; finished in 0.62s

error: test failed, to rerun pass '--test check'
@zhiburt
Copy link
Owner

zhiburt commented Oct 28, 2022

Hmmm I actually think it must fail.
I mean I kind of don't remember why would it be true on macos.

It could be that I've tested it on some BSD and because of that changed the line accidentally.

thanks for report @james-chf

@zhiburt
Copy link
Owner

zhiburt commented Mar 29, 2023

indeed;

https://github.com/zhiburt/expectrl/actions/runs/4557450646/jobs/8039107825#step:3:128

PS: I am very sorry that it got delayed until being addressed.

zhiburt added a commit that referenced this issue Mar 29, 2023
@zhiburt
Copy link
Owner

zhiburt commented Mar 30, 2023

must be fixed;

@zhiburt zhiburt closed this as completed Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants