aboutsummaryrefslogtreecommitdiff
path: root/src/makefile/inference_rules.rs
diff options
context:
space:
mode:
authorMelody Horn <melody@boringcactus.com>2021-04-04 12:57:08 -0600
committerMelody Horn <melody@boringcactus.com>2021-04-04 12:57:08 -0600
commit2c457b4181340fb078ada4d8de505adb2d0f273c (patch)
tree2a7308913f2263bdeb8468cf09893eef0645e66b /src/makefile/inference_rules.rs
parent9ab7620d5b905f07a41d26edd1255b9b606cd330 (diff)
downloadmakers-2c457b4181340fb078ada4d8de505adb2d0f273c.tar.gz
makers-2c457b4181340fb078ada4d8de505adb2d0f273c.zip
add a unit test for `%`-matching in inference rules
Diffstat (limited to 'src/makefile/inference_rules.rs')
-rw-r--r--src/makefile/inference_rules.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/makefile/inference_rules.rs b/src/makefile/inference_rules.rs
index 7a636df..86e5598 100644
--- a/src/makefile/inference_rules.rs
+++ b/src/makefile/inference_rules.rs
@@ -77,4 +77,21 @@ mod test {
assert!(rule.matches("dir/foo.o")?);
Ok(())
}
+
+ #[cfg(feature = "full")]
+ #[test]
+ fn percent_match() -> R {
+ // thanks, SPDX License List
+ let rule = InferenceRule {
+ products: vec!["licenseListPublisher-%.jar-valid".to_owned()],
+ prerequisites: vec![
+ "licenseListPublisher-%.jar.asc".to_owned(),
+ "licenseListPublisher-%.jar".to_owned(),
+ "goneall.gpg".to_owned(),
+ ],
+ commands: vec![],
+ };
+ assert!(rule.matches("licenseListPublisher-2.2.1.jar-valid")?);
+ Ok(())
+ }
}