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

@ -60,10 +60,11 @@ impl RustyPipeQuery {
#[cfg(test)]
mod tests {
use std::{fs::File, io::BufReader, path::Path};
use std::{fs::File, io::BufReader};
use crate::{client::response, model::ChannelRss};
use path_macro::path;
use rstest::rstest;
#[rstest]
@ -71,8 +72,7 @@ mod tests {
#[case::no_likes("no_likes")]
#[case::no_channel_id("no_channel_id")]
fn map_channel_rss(#[case] name: &str) {
let filename = format!("testfiles/channel_rss/{}.xml", name);
let xml_path = Path::new(&filename);
let xml_path = path!("testfiles" / "channel_rss" / format!("{}.xml", name));
let xml_file = File::open(xml_path).unwrap();
let feed: response::ChannelRss =