mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
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:
+1
-1
@@ -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"
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user