fix: use path_macro in tests/codegen for cross-platform paths

This commit is contained in:
ThetaDev 2022-11-30 10:04:16 +01:00
parent 394f8609a8
commit 64d009615e
25 changed files with 150 additions and 151 deletions

View file

@ -935,13 +935,15 @@ pub(crate) fn map_queue_item(item: QueueMusicItem, lang: Language) -> TrackItem
#[cfg(test)]
mod tests {
use std::{collections::BTreeMap, fs::File, io::BufReader, path::Path};
use std::{collections::BTreeMap, fs::File, io::BufReader};
use path_macro::path;
use super::*;
#[test]
fn map_album_type_samples() {
let json_path = Path::new("testfiles/dict/album_type_samples.json");
let json_path = path!("testfiles" / "dict" / "album_type_samples.json");
let json_file = File::open(json_path).unwrap();
let atype_samples: BTreeMap<Language, BTreeMap<AlbumType, String>> =
serde_json::from_reader(BufReader::new(json_file)).unwrap();