mirror of
https://codeberg.org/demostf/api-client.git
synced 2026-06-03 16:44:09 +02:00
make player sorting fully stable
This commit is contained in:
parent
59c9efe395
commit
fe8f1bd348
1 changed files with 11 additions and 6 deletions
|
|
@ -147,18 +147,23 @@ async fn test_get_demo() {
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut players = demo.players;
|
let mut players = demo.players;
|
||||||
players.sort_by(|a, b| a.player_id.cmp(&b.player_id));
|
players.sort_by(|a, b| {
|
||||||
|
a.user
|
||||||
|
.steam_id
|
||||||
|
.account_id()
|
||||||
|
.cmp(&b.user.steam_id.account_id())
|
||||||
|
});
|
||||||
|
|
||||||
assert_eq!(players[0].player_id, 1);
|
assert_eq!(players[0].user.steam_id, SteamID::from(76561198010628997));
|
||||||
assert_eq!(players[0].user.id, 2);
|
assert_eq!(players[0].user.name, "freak u ___");
|
||||||
assert_eq!(players[0].user.name, "distraughtduck4");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn test_get_chat() {
|
async fn test_get_chat() {
|
||||||
let client = test_client().await;
|
let client = test_client().await;
|
||||||
|
|
||||||
let chat = client.get_chat(1).await.unwrap();
|
let mut chat = client.get_chat(1).await.unwrap();
|
||||||
|
chat.sort_by(|a, b| a.time.cmp(&b.time));
|
||||||
|
|
||||||
assert_eq!(chat.len(), 134);
|
assert_eq!(chat.len(), 134);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue