From b25fb845280bf3717644371efd7f4f73705ec808 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Tue, 13 Apr 2021 16:56:35 -0600 Subject: what in the goddamn fuck --- src/makefile/input.rs | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/makefile') 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(()) + } } -- cgit v1.2.3