Separate the collection from beets output in tests #114

Merged
wojtek merged 8 commits from 113---separate-the-collection-from-beets-output-in-tests into main 2024-01-21 15:29:37 +01:00
3 changed files with 316 additions and 333 deletions
Showing only changes of commit d59bca8194 - Show all commits

View File

@ -1,8 +1,4 @@
use once_cell::sync::Lazy;
macro_rules! database_json {
() => {
"[\
pub static DATABASE_JSON: &str = "[\
{\
\"id\":{\"name\":\"album_artist a\"},\
\"sort\":null,\
@ -137,8 +133,4 @@ macro_rules! database_json {
}\
]\
}\
]"
};
}
pub static DATABASE_JSON: Lazy<&str> = Lazy::new(|| database_json!());
]";

View File

@ -1,7 +1,6 @@
use once_cell::sync::Lazy;
macro_rules! library_beets {
() => {
pub static LIBRARY_BEETS: Lazy<Vec<String>> = Lazy::new(|| -> Vec<String> {
vec![
String::from("album_artist a -*^- -*^- 1998 -*^- album_title a.a -*^- 1 -*^- track a.a.1 -*^- artist a.a.1 -*^- FLAC -*^- 992"),
String::from("album_artist a -*^- -*^- 1998 -*^- album_title a.a -*^- 2 -*^- track a.a.2 -*^- artist a.a.2.1; artist a.a.2.2 -*^- MP3 -*^- 320"),
@ -17,7 +16,4 @@ macro_rules! library_beets {
String::from("album_artist c -*^- -*^- 2018 -*^- album_title c.b -*^- 1 -*^- track c.b.1 -*^- artist c.b.1 -*^- FLAC -*^- 1041"),
String::from("album_artist c -*^- -*^- 2018 -*^- album_title c.b -*^- 2 -*^- track c.b.2 -*^- artist c.b.2.1; artist c.b.2.2 -*^- FLAC -*^- 756")
]
};
}
pub static LIBRARY_BEETS: Lazy<Vec<String>> = Lazy::new(|| library_beets!());
});

View File

@ -1,10 +1,8 @@
use once_cell::sync::Lazy;
use crate::library::Item;
use crate::Format;
use crate::{library::Item, Format};
macro_rules! library_items {
() => {
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| -> Vec<Item> {
vec![
Item {
album_artist: String::from("album_artist a"),
@ -165,7 +163,4 @@ macro_rules! library_items {
track_bitrate: 756,
},
]
};
}
pub static LIBRARY_ITEMS: Lazy<Vec<Item>> = Lazy::new(|| library_items!());
});