diff options
Diffstat (limited to 'src/makefile/mod.rs')
-rw-r--r-- | src/makefile/mod.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/makefile/mod.rs b/src/makefile/mod.rs index c48c030..582c62d 100644 --- a/src/makefile/mod.rs +++ b/src/makefile/mod.rs @@ -693,6 +693,8 @@ mod test { use super::*; + type R = anyhow::Result<()>; + fn empty_makefile(args: &Args) -> Makefile { Makefile { inference_rules: vec![], @@ -704,7 +706,7 @@ mod test { } #[test] - fn basic_conditionals() { + fn basic_conditionals() -> R { let file = " ifeq (1,1) worked = yes @@ -714,16 +716,17 @@ endif "; let args = Args::empty(); let mut makefile = empty_makefile(&args); - makefile.and_read(Cursor::new(file)); + makefile.and_read(Cursor::new(file))?; assert_eq!( - makefile.expand_macros(&TokenString::r#macro("worked"), None), + makefile.expand_macros(&TokenString::r#macro("worked"), None)?, "yes" ); + Ok(()) } #[test] #[ignore = "I still haven't implemented `eval` or `define` or %-based macro substitution."] - fn eval() { + fn eval() -> R { // This, for the record, is a terrible misfeature. // If you need this, you probably shouldn't be using Make. // But a lot of people are using this and still use Make anyway, so here we go, @@ -759,7 +762,8 @@ clean: let args = Args::empty(); let mut makefile = empty_makefile(&args); - makefile.and_read(Cursor::new(file)); - assert!(makefile.targets.borrow().contains_key("server")) + makefile.and_read(Cursor::new(file))?; + assert!(makefile.targets.borrow().contains_key("server")); + Ok(()) } } |