diff options
author | Melody Horn <melody@boringcactus.com> | 2021-03-31 13:16:08 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-03-31 13:16:08 -0600 |
commit | 42bdec6488da15a12f2324526bf81abd389f2b4d (patch) | |
tree | 613e286384e485bb95a11e5b25a609e105f5d3d5 /src/makefile/mod.rs | |
parent | dc02827184245392d3059bea150814d28d34a7fe (diff) | |
download | makers-42bdec6488da15a12f2324526bf81abd389f2b4d.tar.gz makers-42bdec6488da15a12f2324526bf81abd389f2b4d.zip |
fix the tests oops
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(()) } } |