fix: use fixed testfiles location

This commit is contained in:
ThetaDev 2023-03-25 23:18:49 +01:00
parent 3a2e4c8abe
commit 7bcff13eb8
20 changed files with 80 additions and 62 deletions

View file

@ -302,6 +302,7 @@ mod tests {
use time::macros::{date, datetime};
use super::*;
use crate::util::tests::TESTFILES;
#[rstest]
#[case(Language::De, "vor 1 Sekunde", Some(TimeAgo { n: 1, unit: TimeUnit::Second }))]
@ -319,7 +320,7 @@ mod tests {
#[test]
fn t_testfile() {
let json_path = path!("testfiles" / "dict" / "timeago_samples.json");
let json_path = path!(*TESTFILES / "dict" / "timeago_samples.json");
let expect = [
TimeAgo {
@ -500,7 +501,7 @@ mod tests {
cases: BTreeMap<String, u8>,
}
let json_path = path!("testfiles" / "dict" / "timeago_table.json");
let json_path = path!(*TESTFILES / "dict" / "timeago_table.json");
let json_file = File::open(json_path).unwrap();
let timeago_table: TimeagoTable =
serde_json::from_reader(BufReader::new(json_file)).unwrap();
@ -545,7 +546,7 @@ mod tests {
#[test]
fn t_parse_date_samples() {
let json_path = path!("testfiles" / "dict" / "playlist_samples.json");
let json_path = path!(*TESTFILES / "dict" / "playlist_samples.json");
let json_file = File::open(json_path).unwrap();
let date_samples: BTreeMap<Language, BTreeMap<String, String>> =
serde_json::from_reader(BufReader::new(json_file)).unwrap();