diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/makefile/input.rs | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/makefile/input.rs b/src/makefile/input.rs index e8e2e95..0618109 100644 --- a/src/makefile/input.rs +++ b/src/makefile/input.rs @@ -971,4 +971,41 @@ clean: assert!(makefile.targets.contains_key("server")); Ok(()) } + + #[test] + fn comment_bullshit() -> R { + let file = " +foo: bar baz#swag +example: test\\#post +info: +\thello # there +"; + eprintln!("{}", file); + let args = Args::empty(); + let makefile = MakefileReader::read(&args, MacroSet::new(), Cursor::new(file), "")?; + let makefile = makefile.finish(); + assert_eq!( + makefile.targets["foo"], + Target { + name: "foo".to_owned(), + prerequisites: vec!["bar".to_owned(), "baz".to_owned()], + commands: vec![], + stem: None, + already_updated: Cell::new(false) + } + ); + dbg!(&makefile.targets); + assert_eq!( + makefile.targets["example"], + Target { + name: "example".to_owned(), + prerequisites: vec!["test#post".to_owned()], + commands: vec![], + stem: None, + already_updated: Cell::new(false) + } + ); + + Ok(()) + } } |