Test sorting after adding key
All checks were successful
Cargo CI / Build and Test (pull_request) Successful in 1m0s
Cargo CI / Lint (pull_request) Successful in 43s

This commit is contained in:
Wojciech Kozlowski 2024-01-13 15:39:57 +01:00
parent 5694ba5666
commit 665dc8eca8

View File

@ -1211,6 +1211,9 @@ mod tests {
assert!(artist_2 < artist_1);
assert_eq!(artist_1, &music_hoard.collection[1]);
assert_eq!(artist_2, &music_hoard.collection[0]);
music_hoard
.set_artist_sort(artist_1_id.as_ref(), artist_1_sort.clone())
.unwrap();
@ -1220,12 +1223,18 @@ mod tests {
assert!(artist_1 < artist_2);
assert_eq!(artist_1, &music_hoard.collection[0]);
assert_eq!(artist_2, &music_hoard.collection[1]);
music_hoard.clear_artist_sort(artist_1_id.as_ref()).unwrap();
let artist_1: &Artist = music_hoard.get_artist(&artist_1_id).unwrap();
let artist_2: &Artist = music_hoard.get_artist(&artist_2_id).unwrap();
assert!(artist_2 < artist_1);
assert_eq!(artist_1, &music_hoard.collection[1]);
assert_eq!(artist_2, &music_hoard.collection[0]);
}
#[test]