Remove the whole #var1 thing

This commit is contained in:
Richard Feldman 2023-09-17 01:00:15 -04:00
parent f4937e72cc
commit 074401fbdf
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B
11 changed files with 39 additions and 185 deletions

View file

@ -126,19 +126,13 @@ pub fn expect_success(input: &str, expected: &str) {
assert_multiline_str_eq!("", out.stderr.as_str());
// Don't consider the auto variable name (e.g. "# val1") at the end.
// The state.rs tests do that!
let mut iter = out.stdout.lines().rev();
let line = iter.next().unwrap();
let comment_index = line.rfind('#').unwrap_or(line.len());
let line_without_comment = line[0..comment_index].trim_end();
// Sometimes the "# val1" wraps around to its own line; if this happens,
// we just use the preceding line instead.
if line_without_comment.is_empty() {
if line.is_empty() {
assert_multiline_str_eq!(expected, iter.next().unwrap().trim_end());
} else {
assert_multiline_str_eq!(expected, line_without_comment);
assert_multiline_str_eq!(expected, line);
}
assert!(out.status.success());