* plugins; datapacks

* merge fixes/changes

---------

Co-authored-by: Geometrically <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Wyatt Verchere
2023-11-25 17:11:38 -08:00
committed by GitHub
parent 172b93d07f
commit bad350e49b
9 changed files with 163 additions and 90 deletions

View File

@@ -1,3 +1,5 @@
use itertools::Itertools;
use std::collections::HashSet;
use crate::common::{
@@ -12,33 +14,38 @@ async fn get_tags() {
let game_versions = api.get_game_versions_deserialized().await;
let loaders = api.get_loaders_deserialized().await;
let side_types = api.get_side_types_deserialized().await;
let categories = api.get_categories_deserialized().await;
// These tests match dummy data and will need to be updated if the dummy data changes;
// These tests match dummy data and will need to be updated if the dummy data changes
// Versions should be ordered by:
// - ordering
// - ordering ties settled by date added to database
// - We also expect presentation of NEWEST to OLDEST
// - All null orderings are treated as older than any non-null ordering
// (for this test, the 1.20.1, etc, versions are all null ordering)
let game_version_versions = game_versions
.into_iter()
.map(|x| x.version)
.collect::<HashSet<_>>();
.collect::<Vec<_>>();
assert_eq!(
game_version_versions,
[
"1.20.1",
"1.20.2",
"1.20.3",
"1.20.4",
"1.20.5",
"Ordering_Negative1",
"Ordering_Positive100"
"Ordering_Positive100",
"1.20.5",
"1.20.4",
"1.20.3",
"1.20.2",
"1.20.1"
]
.iter()
.map(|s| s.to_string())
.collect()
.collect_vec()
);
let loader_names = loaders.into_iter().map(|x| x.name).collect::<HashSet<_>>();
assert_eq!(
loader_names,
["fabric", "forge", "mrpack"]
["fabric", "forge", "mrpack", "bukkit", "waterfall"]
.iter()
.map(|s| s.to_string())
.collect()
@@ -52,26 +59,6 @@ async fn get_tags() {
.map(|s| s.to_string())
.collect()
);
let category_names = categories
.into_iter()
.map(|x| x.name)
.collect::<HashSet<_>>();
assert_eq!(
category_names,
[
"combat",
"economy",
"food",
"optimization",
"decoration",
"mobs",
"magic"
]
.iter()
.map(|s| s.to_string())
.collect()
);
})
.await;
}