You've already forked AstralRinth
forked from didirus/AstralRinth
Version ordering [MOD-551] (#740)
* Version ordering * cargo sqlx prepare * Use version ordering for maven * Use version ordering when sorting versions in Rust (not just SQL) * Thanks clippy
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
#![allow(dead_code)]
|
||||
|
||||
use crate::common::get_json_val_str;
|
||||
use itertools::Itertools;
|
||||
|
||||
pub fn assert_status(response: &actix_web::dev::ServiceResponse, status: actix_http::StatusCode) {
|
||||
assert_eq!(response.status(), status, "{:#?}", response.response());
|
||||
}
|
||||
|
||||
pub fn assert_version_ids(
|
||||
versions: &[labrinth::models::projects::Version],
|
||||
expected_ids: Vec<String>,
|
||||
) {
|
||||
let version_ids = versions
|
||||
.iter()
|
||||
.map(|v| get_json_val_str(v.id))
|
||||
.collect_vec();
|
||||
assert_eq!(version_ids, expected_ids);
|
||||
}
|
||||
|
||||
pub fn assert_any_status_except(
|
||||
response: &actix_web::dev::ServiceResponse,
|
||||
status: actix_http::StatusCode,
|
||||
|
||||
Reference in New Issue
Block a user