mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Remove the whole #var1 thing
This commit is contained in:
parent
f4937e72cc
commit
074401fbdf
11 changed files with 39 additions and 185 deletions
|
@ -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());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue