aboutsummaryrefslogtreecommitdiff
path: root/tests/conditional_assignment_inheritance.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2024-11-11 14:46:19 -0700
committerMelody Horn <melody@boringcactus.com>2024-11-11 14:46:19 -0700
commitfbbcf325b8bbe72f924da6a7cdb128d973ef0026 (patch)
tree783dc988b77c95fd739b30a436a496b7c0c550c2 /tests/conditional_assignment_inheritance.rs
parent5aa6e1122830611dccc2eab9b7f4a53a10056111 (diff)
downloadmakers-fbbcf325b8bbe72f924da6a7cdb128d973ef0026.tar.gz
makers-fbbcf325b8bbe72f924da6a7cdb128d973ef0026.zip
fix conditional assignment when original is inherited
Diffstat (limited to 'tests/conditional_assignment_inheritance.rs')
-rw-r--r--tests/conditional_assignment_inheritance.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/conditional_assignment_inheritance.rs b/tests/conditional_assignment_inheritance.rs
new file mode 100644
index 0000000..cb7e806
--- /dev/null
+++ b/tests/conditional_assignment_inheritance.rs
@@ -0,0 +1,28 @@
+mod utils;
+
+use std::fs;
+use utils::{make, R};
+
+#[test]
+#[cfg(feature = "full")]
+fn conditional_assignment_inheritance_test() -> R {
+ let dir = tempfile::tempdir()?;
+
+ let file_a = "
+EGG = bug
+include file_b.mk
+check:
+\t@echo $(EGG)
+";
+ fs::write(dir.path().join("Makefile"), file_a)?;
+ let file_b = "
+EGG ?= nope
+";
+ fs::write(dir.path().join("file_b.mk"), file_b)?;
+
+ let result = make(&dir)?;
+ assert!(result.status.success());
+ assert_eq!(String::from_utf8(result.stdout)?.trim(), "bug");
+
+ Ok(())
+}