From fbbcf325b8bbe72f924da6a7cdb128d973ef0026 Mon Sep 17 00:00:00 2001 From: Melody Horn Date: Mon, 11 Nov 2024 14:46:19 -0700 Subject: fix conditional assignment when original is inherited --- tests/conditional_assignment_inheritance.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 tests/conditional_assignment_inheritance.rs (limited to 'tests/conditional_assignment_inheritance.rs') 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(()) +} -- cgit v1.2.3