mirror of
https://github.com/modrinth/code.git
synced 2026-08-26 09:34:50 +00:00
add round-trip tests
This commit is contained in:
@@ -574,12 +574,7 @@ async fn minecraft_game_version_update() {
|
||||
// A couple specific checks- in the dummy data, all game versions are marked as major=false except 1.20.5
|
||||
let name_to_major = game_versions
|
||||
.iter()
|
||||
.map(|x| {
|
||||
(
|
||||
x.value.clone(),
|
||||
x.metadata.get("major").unwrap().as_bool().unwrap(),
|
||||
)
|
||||
})
|
||||
.map(|x| (x.value.clone(), x.metadata.as_ref().unwrap().major))
|
||||
.collect::<std::collections::HashMap<_, _>>();
|
||||
for (name, major) in name_to_major {
|
||||
if name == "1.20.5" {
|
||||
@@ -612,12 +607,7 @@ async fn minecraft_game_version_update() {
|
||||
|
||||
let name_to_major = game_versions
|
||||
.iter()
|
||||
.map(|x| {
|
||||
(
|
||||
x.value.clone(),
|
||||
x.metadata.get("major").unwrap().as_bool().unwrap(),
|
||||
)
|
||||
})
|
||||
.map(|x| (x.value.clone(), x.metadata.as_ref().unwrap().major))
|
||||
.collect::<std::collections::HashMap<_, _>>();
|
||||
// Confirm that the new version is there
|
||||
assert!(name_to_major.contains_key("1.20.6"));
|
||||
|
||||
@@ -47,12 +47,7 @@ async fn get_tags_v3() {
|
||||
|
||||
let loader_metadata = loaders
|
||||
.into_iter()
|
||||
.map(|x| {
|
||||
(
|
||||
x.name,
|
||||
x.metadata.get("platform").and_then(|x| x.as_bool()),
|
||||
)
|
||||
})
|
||||
.map(|x| (x.name, x.metadata.platform))
|
||||
.collect::<HashMap<_, _>>();
|
||||
let loader_names =
|
||||
loader_metadata.keys().cloned().collect::<HashSet<String>>();
|
||||
|
||||
Reference in New Issue
Block a user