Require loot-condition-interpreter v6

It includes new functionality that is required for the metadata syntax v0.29.

Add a couple of tests that rely on that new functionality so that the
dependency is backed by tests that fail if it's not met.
This commit is contained in:
Oliver Hamlet
2026-01-27 20:09:28 +00:00
parent 7fee083704
commit 832690957a
2 changed files with 28 additions and 1 deletions
+1 -1
View File
@@ -12,7 +12,7 @@ crc32fast = "1"
esplugin = "6.1"
libloadorder = "18.5"
log = { version = "0.4.6", features = ["std"] }
loot-condition-interpreter = ">= 5, < 7"
loot-condition-interpreter = "6"
petgraph = ">= 0.6, < 0.9"
rayon = "1"
regress = "0.10.5"
+27
View File
@@ -194,4 +194,31 @@ mod tests {
assert!(evaluate_all_conditions(plugin, &state).unwrap().is_none());
}
}
mod evaluate_condition {
use crate::tests::source_plugins_path;
use super::*;
#[test]
fn should_support_version_with_comparator_as_second_parameter() {
let mut state = loot_condition_interpreter::State::new(
loot_condition_interpreter::GameType::Oblivion,
source_plugins_path(crate::GameType::Oblivion),
);
state.set_plugin_versions(&[("Blank.esp", "1.0.0")]);
assert!(evaluate_condition("version(\"Blank.esp\", ==, \"1.0.0\")", &state).unwrap());
}
#[test]
fn should_eval_less_than_missing_version_as_false() {
let state = loot_condition_interpreter::State::new(
loot_condition_interpreter::GameType::Oblivion,
source_plugins_path(crate::GameType::Oblivion),
);
assert!(!evaluate_condition("version(\"example.esp\", \"1.0.0\", <)", &state).unwrap());
}
}
}