mirror of
https://github.com/loot/loot-condition-interpreter.git
synced 2026-07-27 14:16:09 -07:00
Move test resources into subdirectory
This commit is contained in:
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
/target/
|
/target/
|
||||||
**/*.rs.bk
|
**/*.rs.bk
|
||||||
Cargo.lock
|
Cargo.lock
|
||||||
/testing-plugins
|
/tests/testing-plugins
|
||||||
/loot_api*
|
/tests/loot_api*
|
||||||
/ffi/include/
|
/ffi/include/
|
||||||
/ffi/build/
|
/ffi/build/
|
||||||
.vscode
|
.vscode
|
||||||
|
|||||||
@@ -12,15 +12,22 @@ install:
|
|||||||
- rustfmt --version
|
- rustfmt --version
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
|
- mkdir tests
|
||||||
|
- cd tests
|
||||||
|
|
||||||
- wget https://github.com/WrinklyNinja/testing-plugins/archive/1.4.1.tar.gz
|
- wget https://github.com/WrinklyNinja/testing-plugins/archive/1.4.1.tar.gz
|
||||||
- tar -xf 1.4.1.tar.gz
|
- tar -xf 1.4.1.tar.gz
|
||||||
- mv testing-plugins-1.4.1 testing-plugins
|
- mv testing-plugins-1.4.1 testing-plugins
|
||||||
|
|
||||||
- wget https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win32.7z
|
- wget https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win32.7z
|
||||||
- 7z x loot_api-0.13.8-0-g47797cc_dev-win32.7z
|
- 7z x loot_api-0.13.8-0-g47797cc_dev-win32.7z
|
||||||
|
- mv loot_api-0.13.8-0-g47797cc_dev-win32 loot_api_win32
|
||||||
|
|
||||||
- wget https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win64.7z
|
- wget https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win64.7z
|
||||||
- 7z x loot_api-0.13.8-0-g47797cc_dev-win64.7z
|
- 7z x loot_api-0.13.8-0-g47797cc_dev-win64.7z
|
||||||
|
- mv loot_api-0.13.8-0-g47797cc_dev-win64 loot_api_win64
|
||||||
|
|
||||||
|
- cd ..
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- cargo fmt --all -- --check
|
- cargo fmt --all -- --check
|
||||||
|
|||||||
+13
-6
@@ -16,15 +16,22 @@ install:
|
|||||||
- rustup component add rustfmt-preview
|
- rustup component add rustfmt-preview
|
||||||
- rustfmt --version
|
- rustfmt --version
|
||||||
|
|
||||||
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/WrinklyNinja/testing-plugins/archive/1.4.0.zip', "$env:APPVEYOR_BUILD_FOLDER\1.4.0.zip")
|
- ps: mkdir tests
|
||||||
- ps: 7z x "$env:APPVEYOR_BUILD_FOLDER\1.4.0.zip"
|
- cd tests
|
||||||
|
|
||||||
|
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/WrinklyNinja/testing-plugins/archive/1.4.0.zip', "$PWD/1.4.0.zip")
|
||||||
|
- 7z x 1.4.0.zip
|
||||||
- mv testing-plugins-1.4.0 testing-plugins
|
- mv testing-plugins-1.4.0 testing-plugins
|
||||||
|
|
||||||
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win32.7z', "$env:APPVEYOR_BUILD_FOLDER\loot_api-0.13.8-0-g47797cc_dev-win32.7z")
|
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win32.7z', "$PWD/loot_api_win32.7z")
|
||||||
- ps: 7z x "$env:APPVEYOR_BUILD_FOLDER\loot_api-0.13.8-0-g47797cc_dev-win32.7z"
|
- 7z x loot_api_win32.7z
|
||||||
|
- mv loot_api-0.13.8-0-g47797cc_dev-win32 loot_api_win32
|
||||||
|
|
||||||
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win64.7z', "$env:APPVEYOR_BUILD_FOLDER\loot_api-0.13.8-0-g47797cc_dev-win64.7z")
|
- ps: (New-Object Net.WebClient).DownloadFile('https://github.com/loot/loot-api/releases/download/0.13.8/loot_api-0.13.8-0-g47797cc_dev-win64.7z', "$PWD/loot_api_win64.7z")
|
||||||
- ps: 7z x "$env:APPVEYOR_BUILD_FOLDER\loot_api-0.13.8-0-g47797cc_dev-win64.7z"
|
- 7z x loot_api_win64.7z
|
||||||
|
- mv loot_api-0.13.8-0-g47797cc_dev-win64 loot_api_win64
|
||||||
|
|
||||||
|
- cd ..
|
||||||
|
|
||||||
build: false
|
build: false
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -43,7 +43,7 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
c.bench_function("Expression.eval() active(path)", |b| {
|
c.bench_function("Expression.eval() active(path)", |b| {
|
||||||
let state = State::new(
|
let state = State::new(
|
||||||
GameType::Tes4,
|
GameType::Tes4,
|
||||||
"testing-plugins/Oblivion/Data".into(),
|
"tests/testing-plugins/Oblivion/Data".into(),
|
||||||
".".into(),
|
".".into(),
|
||||||
).with_active_plugins(&generate_active_plugins());
|
).with_active_plugins(&generate_active_plugins());
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
c.bench_function("Expression.eval() active(regex)", |b| {
|
c.bench_function("Expression.eval() active(regex)", |b| {
|
||||||
let state = State::new(
|
let state = State::new(
|
||||||
GameType::Tes4,
|
GameType::Tes4,
|
||||||
"testing-plugins/Oblivion/Data".into(),
|
"tests/testing-plugins/Oblivion/Data".into(),
|
||||||
".".into(),
|
".".into(),
|
||||||
).with_active_plugins(&generate_active_plugins());
|
).with_active_plugins(&generate_active_plugins());
|
||||||
|
|
||||||
@@ -80,7 +80,7 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
c.bench_function("Expression.eval() many_active()", |b| {
|
c.bench_function("Expression.eval() many_active()", |b| {
|
||||||
let state = State::new(
|
let state = State::new(
|
||||||
GameType::Tes4,
|
GameType::Tes4,
|
||||||
"testing-plugins/Oblivion/Data".into(),
|
"tests/testing-plugins/Oblivion/Data".into(),
|
||||||
".".into(),
|
".".into(),
|
||||||
).with_active_plugins(&generate_active_plugins());
|
).with_active_plugins(&generate_active_plugins());
|
||||||
|
|
||||||
@@ -94,7 +94,7 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
c.bench_function("Expression.eval() checksum()", |b| {
|
c.bench_function("Expression.eval() checksum()", |b| {
|
||||||
let state = State::new(
|
let state = State::new(
|
||||||
GameType::Tes4,
|
GameType::Tes4,
|
||||||
"testing-plugins/Oblivion/Data".into(),
|
"tests/testing-plugins/Oblivion/Data".into(),
|
||||||
".".into(),
|
".".into(),
|
||||||
);
|
);
|
||||||
let expression = Expression::from_str("checksum(\"Blank.esm\", 374E2A6F)").unwrap();
|
let expression = Expression::from_str("checksum(\"Blank.esm\", 374E2A6F)").unwrap();
|
||||||
@@ -107,7 +107,7 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
c.bench_function("Expression.eval() version(plugin)", |b| {
|
c.bench_function("Expression.eval() version(plugin)", |b| {
|
||||||
let state = State::new(
|
let state = State::new(
|
||||||
GameType::Tes4,
|
GameType::Tes4,
|
||||||
"testing-plugins/Oblivion/Data".into(),
|
"tests/testing-plugins/Oblivion/Data".into(),
|
||||||
".".into(),
|
".".into(),
|
||||||
).with_plugin_versions(&generate_plugin_versions());
|
).with_plugin_versions(&generate_plugin_versions());
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ fn criterion_benchmark(c: &mut Criterion) {
|
|||||||
c.bench_function("Expression.eval() version(executable)", |b| {
|
c.bench_function("Expression.eval() version(executable)", |b| {
|
||||||
let state = State::new(GameType::Tes4, ".".into(), ".".into());
|
let state = State::new(GameType::Tes4, ".".into(), ".".into());
|
||||||
let expression = Expression::from_str(
|
let expression = Expression::from_str(
|
||||||
"version(\"loot_api-0.13.8-0-g47797cc_dev-win32/loot_api.dll\", \"0.13.8.0\", ==)",
|
"version(\"tests/loot_api_win32/loot_api.dll\", \"0.13.8.0\", ==)",
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
b.iter(|| {
|
b.iter(|| {
|
||||||
|
|||||||
+4
-4
@@ -65,7 +65,7 @@ void test_lci_condition_eval() {
|
|||||||
printf("testing lci_condition_eval()...\n");
|
printf("testing lci_condition_eval()...\n");
|
||||||
|
|
||||||
lci_state * state = nullptr;
|
lci_state * state = nullptr;
|
||||||
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../testing-plugins/Oblivion/Data", ".");
|
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../tests/testing-plugins/Oblivion/Data", ".");
|
||||||
|
|
||||||
assert(return_code == LCI_OK);
|
assert(return_code == LCI_OK);
|
||||||
assert(state != nullptr);
|
assert(state != nullptr);
|
||||||
@@ -85,7 +85,7 @@ void test_lci_state_set_active_plugins() {
|
|||||||
printf("testing lci_state_set_active_plugins()...\n");
|
printf("testing lci_state_set_active_plugins()...\n");
|
||||||
|
|
||||||
lci_state * state = nullptr;
|
lci_state * state = nullptr;
|
||||||
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../testing-plugins/Oblivion/Data", ".");
|
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../tests/testing-plugins/Oblivion/Data", ".");
|
||||||
|
|
||||||
assert(return_code == LCI_OK);
|
assert(return_code == LCI_OK);
|
||||||
assert(state != nullptr);
|
assert(state != nullptr);
|
||||||
@@ -117,7 +117,7 @@ void test_lci_state_set_plugin_versions() {
|
|||||||
printf("testing lci_state_set_plugin_versions()...\n");
|
printf("testing lci_state_set_plugin_versions()...\n");
|
||||||
|
|
||||||
lci_state * state = nullptr;
|
lci_state * state = nullptr;
|
||||||
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../testing-plugins/Oblivion/Data", ".");
|
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../tests/testing-plugins/Oblivion/Data", ".");
|
||||||
|
|
||||||
assert(return_code == LCI_OK);
|
assert(return_code == LCI_OK);
|
||||||
assert(state != nullptr);
|
assert(state != nullptr);
|
||||||
@@ -152,7 +152,7 @@ void test_lci_state_set_crc_cache() {
|
|||||||
printf("testing lci_state_set_crc_cache()...\n");
|
printf("testing lci_state_set_crc_cache()...\n");
|
||||||
|
|
||||||
lci_state * state = nullptr;
|
lci_state * state = nullptr;
|
||||||
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../testing-plugins/Oblivion/Data", ".");
|
int return_code = lci_state_create(&state, LCI_GAME_TES4, "../../tests/testing-plugins/Oblivion/Data", ".");
|
||||||
|
|
||||||
assert(return_code == LCI_OK);
|
assert(return_code == LCI_OK);
|
||||||
assert(state != nullptr);
|
assert(state != nullptr);
|
||||||
|
|||||||
+45
-29
@@ -330,7 +330,7 @@ mod tests {
|
|||||||
let state = state(data_path);
|
let state = state(data_path);
|
||||||
|
|
||||||
copy(
|
copy(
|
||||||
Path::new("testing-plugins/Oblivion/Data/Blank.esp"),
|
Path::new("tests/testing-plugins/Oblivion/Data/Blank.esp"),
|
||||||
&state.data_path.join("Blank.esp.ghost"),
|
&state.data_path.join("Blank.esp.ghost"),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
@@ -400,7 +400,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn function_file_regex_eval_should_be_true_if_a_directory_entry_matches() {
|
fn function_file_regex_eval_should_be_true_if_a_directory_entry_matches() {
|
||||||
let function = Function::FileRegex(
|
let function = Function::FileRegex(
|
||||||
PathBuf::from("testing-plugins/Oblivion/Data"),
|
PathBuf::from("tests/testing-plugins/Oblivion/Data"),
|
||||||
regex("Blank\\.esp"),
|
regex("Blank\\.esp"),
|
||||||
);
|
);
|
||||||
let state = state(".");
|
let state = state(".");
|
||||||
@@ -467,7 +467,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn function_many_eval_should_be_false_if_one_directory_entry_matches() {
|
fn function_many_eval_should_be_false_if_one_directory_entry_matches() {
|
||||||
let function = Function::Many(
|
let function = Function::Many(
|
||||||
PathBuf::from("testing-plugins/Oblivion/Data"),
|
PathBuf::from("tests/testing-plugins/Oblivion/Data"),
|
||||||
regex("Blank\\.esp"),
|
regex("Blank\\.esp"),
|
||||||
);
|
);
|
||||||
let state = state(".");
|
let state = state(".");
|
||||||
@@ -478,7 +478,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn function_many_eval_should_be_true_if_more_than_one_directory_entry_matches() {
|
fn function_many_eval_should_be_true_if_more_than_one_directory_entry_matches() {
|
||||||
let function = Function::Many(
|
let function = Function::Many(
|
||||||
PathBuf::from("testing-plugins/Oblivion/Data"),
|
PathBuf::from("tests/testing-plugins/Oblivion/Data"),
|
||||||
regex("Blank.*"),
|
regex("Blank.*"),
|
||||||
);
|
);
|
||||||
let state = state(".");
|
let state = state(".");
|
||||||
@@ -522,7 +522,7 @@ mod tests {
|
|||||||
fn function_checksum_eval_should_be_false_if_the_file_checksum_does_not_equal_the_given_checksum(
|
fn function_checksum_eval_should_be_false_if_the_file_checksum_does_not_equal_the_given_checksum(
|
||||||
) {
|
) {
|
||||||
let function = Function::Checksum(
|
let function = Function::Checksum(
|
||||||
PathBuf::from("testing-plugins/Oblivion/Data/Blank.esm"),
|
PathBuf::from("tests/testing-plugins/Oblivion/Data/Blank.esm"),
|
||||||
0xDEADBEEF,
|
0xDEADBEEF,
|
||||||
);
|
);
|
||||||
let state = state(".");
|
let state = state(".");
|
||||||
@@ -533,7 +533,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn function_checksum_eval_should_be_true_if_the_file_checksum_equals_the_given_checksum() {
|
fn function_checksum_eval_should_be_true_if_the_file_checksum_equals_the_given_checksum() {
|
||||||
let function = Function::Checksum(
|
let function = Function::Checksum(
|
||||||
PathBuf::from("testing-plugins/Oblivion/Data/Blank.esm"),
|
PathBuf::from("tests/testing-plugins/Oblivion/Data/Blank.esm"),
|
||||||
0x374E2A6F,
|
0x374E2A6F,
|
||||||
);
|
);
|
||||||
let state = state(".");
|
let state = state(".");
|
||||||
@@ -548,7 +548,7 @@ mod tests {
|
|||||||
let state = state(data_path);
|
let state = state(data_path);
|
||||||
|
|
||||||
copy(
|
copy(
|
||||||
Path::new("testing-plugins/Oblivion/Data/Blank.esm"),
|
Path::new("tests/testing-plugins/Oblivion/Data/Blank.esm"),
|
||||||
&state.data_path.join("Blank.esm.ghost"),
|
&state.data_path.join("Blank.esm.ghost"),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
@@ -564,7 +564,7 @@ mod tests {
|
|||||||
let state = state(data_path);
|
let state = state(data_path);
|
||||||
|
|
||||||
copy(
|
copy(
|
||||||
Path::new("testing-plugins/Oblivion/Data/Blank.bsa"),
|
Path::new("tests/testing-plugins/Oblivion/Data/Blank.bsa"),
|
||||||
&state.data_path.join("Blank.bsa.ghost"),
|
&state.data_path.join("Blank.bsa.ghost"),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
@@ -577,7 +577,7 @@ mod tests {
|
|||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
fn function_checksum_eval_should_be_true_if_given_LOOT_crc_matches() {
|
fn function_checksum_eval_should_be_true_if_given_LOOT_crc_matches() {
|
||||||
let function = Function::Checksum(PathBuf::from("LOOT"), 0x374E2A6F);
|
let function = Function::Checksum(PathBuf::from("LOOT"), 0x374E2A6F);
|
||||||
let state = state_with_loot_path(".", "testing-plugins/Oblivion/Data/Blank.esm");
|
let state = state_with_loot_path(".", "tests/testing-plugins/Oblivion/Data/Blank.esm");
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -586,7 +586,7 @@ mod tests {
|
|||||||
#[allow(non_snake_case)]
|
#[allow(non_snake_case)]
|
||||||
fn function_checksum_eval_should_be_false_if_given_LOOT_crc_does_not_match() {
|
fn function_checksum_eval_should_be_false_if_given_LOOT_crc_does_not_match() {
|
||||||
let function = Function::Checksum(PathBuf::from("LOOT"), 0xDEADBEEF);
|
let function = Function::Checksum(PathBuf::from("LOOT"), 0xDEADBEEF);
|
||||||
let state = state_with_loot_path(".", "testing-plugins/Oblivion/Data/Blank.esm");
|
let state = state_with_loot_path(".", "tests/testing-plugins/Oblivion/Data/Blank.esm");
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -598,7 +598,7 @@ mod tests {
|
|||||||
let state = state(data_path);
|
let state = state(data_path);
|
||||||
|
|
||||||
copy(
|
copy(
|
||||||
Path::new("testing-plugins/Oblivion/Data/Blank.esm"),
|
Path::new("tests/testing-plugins/Oblivion/Data/Blank.esm"),
|
||||||
&state.data_path.join("Blank.esm"),
|
&state.data_path.join("Blank.esm"),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
@@ -608,7 +608,7 @@ mod tests {
|
|||||||
|
|
||||||
// Change the CRC of the file to test that the cached value is used.
|
// Change the CRC of the file to test that the cached value is used.
|
||||||
copy(
|
copy(
|
||||||
Path::new("testing-plugins/Oblivion/Data/Blank.bsa"),
|
Path::new("tests/testing-plugins/Oblivion/Data/Blank.bsa"),
|
||||||
&state.data_path.join("Blank.esm"),
|
&state.data_path.join("Blank.esm"),
|
||||||
).unwrap();
|
).unwrap();
|
||||||
|
|
||||||
@@ -702,7 +702,7 @@ mod tests {
|
|||||||
|
|
||||||
let plugin = PathBuf::from("Blank.esm");
|
let plugin = PathBuf::from("Blank.esm");
|
||||||
let version = String::from("1.0");
|
let version = String::from("1.0");
|
||||||
let state = state("./testing-plugins/Oblivion/Data");
|
let state = state("tests/testing-plugins/Oblivion/Data");
|
||||||
|
|
||||||
let function = Function::Version(plugin.clone(), version.clone(), NotEqual);
|
let function = Function::Version(plugin.clone(), version.clone(), NotEqual);
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
@@ -721,7 +721,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn function_version_eval_should_be_false_if_versions_are_not_equal_and_comparator_is_eq() {
|
fn function_version_eval_should_be_false_if_versions_are_not_equal_and_comparator_is_eq() {
|
||||||
let function = Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::Equal);
|
let function = Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::Equal);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "1")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "1")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -729,7 +730,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn function_version_eval_should_be_true_if_versions_are_equal_and_comparator_is_eq() {
|
fn function_version_eval_should_be_true_if_versions_are_equal_and_comparator_is_eq() {
|
||||||
let function = Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::Equal);
|
let function = Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::Equal);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -738,7 +740,8 @@ mod tests {
|
|||||||
fn function_version_eval_should_be_false_if_versions_are_equal_and_comparator_is_ne() {
|
fn function_version_eval_should_be_false_if_versions_are_equal_and_comparator_is_ne() {
|
||||||
let function =
|
let function =
|
||||||
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::NotEqual);
|
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::NotEqual);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -747,7 +750,8 @@ mod tests {
|
|||||||
fn function_version_eval_should_be_true_if_versions_are_not_equal_and_comparator_is_ne() {
|
fn function_version_eval_should_be_true_if_versions_are_not_equal_and_comparator_is_ne() {
|
||||||
let function =
|
let function =
|
||||||
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::NotEqual);
|
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::NotEqual);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "1")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "1")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -756,7 +760,8 @@ mod tests {
|
|||||||
fn function_version_eval_should_be_false_if_actual_version_is_eq_and_comparator_is_lt() {
|
fn function_version_eval_should_be_false_if_actual_version_is_eq_and_comparator_is_lt() {
|
||||||
let function =
|
let function =
|
||||||
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::LessThan);
|
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::LessThan);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -765,7 +770,8 @@ mod tests {
|
|||||||
fn function_version_eval_should_be_false_if_actual_version_is_gt_and_comparator_is_lt() {
|
fn function_version_eval_should_be_false_if_actual_version_is_gt_and_comparator_is_lt() {
|
||||||
let function =
|
let function =
|
||||||
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::LessThan);
|
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::LessThan);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -774,7 +780,8 @@ mod tests {
|
|||||||
fn function_version_eval_should_be_true_if_actual_version_is_lt_and_comparator_is_lt() {
|
fn function_version_eval_should_be_true_if_actual_version_is_lt_and_comparator_is_lt() {
|
||||||
let function =
|
let function =
|
||||||
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::NotEqual);
|
Function::Version("Blank.esm".into(), "5".into(), ComparisonOperator::NotEqual);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "1")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "1")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -786,7 +793,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::GreaterThan,
|
ComparisonOperator::GreaterThan,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -798,7 +806,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::GreaterThan,
|
ComparisonOperator::GreaterThan,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "4")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "4")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -810,7 +819,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::GreaterThan,
|
ComparisonOperator::GreaterThan,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -822,7 +832,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::LessThanOrEqual,
|
ComparisonOperator::LessThanOrEqual,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -834,7 +845,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::LessThanOrEqual,
|
ComparisonOperator::LessThanOrEqual,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -846,7 +858,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::LessThanOrEqual,
|
ComparisonOperator::LessThanOrEqual,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "4")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "4")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -858,7 +871,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::GreaterThanOrEqual,
|
ComparisonOperator::GreaterThanOrEqual,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "4")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "4")]);
|
||||||
|
|
||||||
assert!(!function.eval(&state).unwrap());
|
assert!(!function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -870,7 +884,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::GreaterThanOrEqual,
|
ComparisonOperator::GreaterThanOrEqual,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "5")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
@@ -882,7 +897,8 @@ mod tests {
|
|||||||
"5".into(),
|
"5".into(),
|
||||||
ComparisonOperator::GreaterThanOrEqual,
|
ComparisonOperator::GreaterThanOrEqual,
|
||||||
);
|
);
|
||||||
let state = state_with_versions("./testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
let state =
|
||||||
|
state_with_versions("tests/testing-plugins/Oblivion/Data", &[("Blank.esm", "6")]);
|
||||||
|
|
||||||
assert!(function.eval(&state).unwrap());
|
assert!(function.eval(&state).unwrap());
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-6
@@ -148,9 +148,8 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn version_read_file_version_should_read_the_file_version_field_of_a_32_bit_executable() {
|
fn version_read_file_version_should_read_the_file_version_field_of_a_32_bit_executable() {
|
||||||
let version = Version::read_file_version(Path::new(
|
let version =
|
||||||
"loot_api-0.13.8-0-g47797cc_dev-win32/loot_api.dll",
|
Version::read_file_version(Path::new("tests/loot_api_win32/loot_api.dll")).unwrap();
|
||||||
)).unwrap();
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
version.release_ids,
|
version.release_ids,
|
||||||
@@ -166,9 +165,8 @@ mod tests {
|
|||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn version_read_file_version_should_read_the_file_version_field_of_a_64_bit_executable() {
|
fn version_read_file_version_should_read_the_file_version_field_of_a_64_bit_executable() {
|
||||||
let version = Version::read_file_version(Path::new(
|
let version =
|
||||||
"loot_api-0.13.8-0-g47797cc_dev-win64/loot_api.dll",
|
Version::read_file_version(Path::new("tests/loot_api_win64/loot_api.dll")).unwrap();
|
||||||
)).unwrap();
|
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
version.release_ids,
|
version.release_ids,
|
||||||
|
|||||||
Reference in New Issue
Block a user