Skip to content

Commit

Permalink
fix(core-test): revert to dyn read file
Browse files Browse the repository at this point in the history
  • Loading branch information
SARDONYX-sard committed Oct 11, 2023
1 parent 7231c65 commit 8af1069
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 34 deletions.
2 changes: 1 addition & 1 deletion dar2oar_core/src/fs/mapping_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub fn read_mapping_table(table_path: impl AsRef<Path>) -> anyhow::Result<HashMa
}
}

pub(super) fn parse_mapping_table(table: &str) -> HashMap<String, String> {
fn parse_mapping_table(table: &str) -> HashMap<String, String> {
let mut map = HashMap::new();

// Sequential numbering of duplicate keys when no key is available.
Expand Down
30 changes: 0 additions & 30 deletions dar2oar_core/src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,3 @@ where
config_file.write_all(json.as_bytes())?;
Ok(())
}

#[cfg(test)]
mod test {
use super::*;

#[ignore]
#[test]
fn should_parallel_traverse() -> anyhow::Result<()> {
let config = simple_log::LogConfigBuilder::builder()
.path("../convert.log")
.size(100)
.roll_count(10)
.level("error")
.output_file()
.output_console()
.build();
simple_log::new(config).unwrap();

let table_content = "../test/settings/mapping_table.txt";
let mapping = read_mapping_table(table_content)?;
convert_dar_to_oar(
"../test/data/Modern Female Sitting Animations Overhaul",
None,
None,
None,
Some(mapping),
None,
)
}
}
7 changes: 4 additions & 3 deletions dar2oar_core/src/fs/sequential/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ mod test {
.build();
simple_log::new(config).unwrap();

let table = crate::fs::mapping_table::parse_mapping_table(include_str!(
"../../../../test/settings/UnderDog Animations_mapping_table.txt"
));
// cannot use include_str!
let table =
crate::read_mapping_table("../test/settings/UnderDog Animations_mapping_table.txt")
.unwrap();
convert_dar_to_oar(
"../test/data/UNDERDOG Animations",
None,
Expand Down

0 comments on commit 8af1069

Please sign in to comment.