Skip to content

Commit 1cf14c9

Browse files
committed
Fix tests
Signed-off-by: Wesley Hershberger <wesley.hershberger@gmail.com>
1 parent 67140bb commit 1cf14c9

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

src/pam/rpassword.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ mod test {
347347
fn miri_test_read() {
348348
let mut data = "password123\nhello world".as_bytes();
349349
let mut stdout = Vec::new();
350-
let buf = read_unbuffered(&mut data, &mut stdout, None, Feedback::No).unwrap();
350+
let buf = read_unbuffered(&mut data, &mut stdout, Hidden::No).unwrap();
351351
// check that the \n is not part of input
352352
assert_eq!(
353353
buf.iter()
@@ -363,20 +363,8 @@ mod test {
363363
#[test]
364364
fn miri_test_longpwd() {
365365
let mut stdout = Vec::new();
366-
assert!(read_unbuffered(
367-
&mut "a".repeat(511).as_bytes(),
368-
&mut stdout,
369-
None,
370-
Feedback::No
371-
)
372-
.is_ok());
373-
assert!(read_unbuffered(
374-
&mut "a".repeat(512).as_bytes(),
375-
&mut stdout,
376-
None,
377-
Feedback::No
378-
)
379-
.is_err());
366+
assert!(read_unbuffered(&mut "a".repeat(511).as_bytes(), &mut stdout, Hidden::No).is_ok());
367+
assert!(read_unbuffered(&mut "a".repeat(512).as_bytes(), &mut stdout, Hidden::No).is_err());
380368
}
381369

382370
#[test]

test-framework/sudo-compliance-tests/src/sudo/nopasswd.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ fn v_flag_without_pwd_fails_if_nopasswd_is_not_set_for_all_users_entries() {
143143
} else {
144144
assert_contains!(
145145
stderr,
146-
"[sudo: authenticate] Password: sudo: Authentication failed, try again.\n[sudo: authenticate] Password: sudo: Authentication failed, try again.\n[sudo: authenticate] Password: sudo-rs: Maximum 3 incorrect authentication attempts"
146+
"[sudo: authenticate] Password: \nsudo: Authentication failed, try again.\n[sudo: authenticate] Password: \nsudo: Authentication failed, try again.\n[sudo: authenticate] Password: \nsudo-rs: Maximum 3 incorrect authentication attempts"
147147
);
148148
}
149149
}

0 commit comments

Comments
 (0)