Skip to content

Commit 906d467

Browse files
committed
Add test for whitespace before main
1 parent bb013fe commit 906d467

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/data/whitespace-before-main.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
println!("--output--");
3+
println!("hello, world");
4+
}

tests/tests/script.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,12 @@ fn test_pub_fn_main() {
170170
)
171171
.unwrap()
172172
}
173+
174+
#[test]
175+
fn test_whitespace_before_main() {
176+
let out = rust_script!("tests/data/whitespace-before-main.rs").unwrap();
177+
scan!(out.stdout_output();
178+
("hello, world") => ()
179+
)
180+
.unwrap()
181+
}

0 commit comments

Comments
 (0)