Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkAndshark committed Dec 27, 2024
1 parent 67f2bd8 commit 8d79503
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions martin/src/args/root.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ pub fn parse_file_args<T: crate::file_config::ConfigExtras>(
#[cfg(test)]
mod tests {

use insta::{assert_snapshot, assert_yaml_snapshot};

use super::*;
use crate::args::PreferredEncoding;
use crate::test_utils::FauxEnv;
Expand Down Expand Up @@ -283,12 +285,22 @@ mod tests {

#[test]
fn cli_multiple_extensions() {
let args = Args::parse_from(["martin", "../tests/fixtures/cog"]);
let args = Args::parse_from([
"martin",
"../tests/fixtures/cog/rgb_u8.tif",
"../tests/fixtures/cog/rgba_u8_nodata.tiff",
"../tests/fixtures/cog/rgba_u8.tif",
]);

let env = FauxEnv::default();
let mut config = Config::default();
let err = args.merge_into_config(&mut config, &env);
println!("{:?}", err);
println!("{:?}", config);
assert!(err.is_ok());
assert_yaml_snapshot!(config, @r#"
cog:
- "../tests/fixtures/cog/rgb_u8.tif"
- "../tests/fixtures/cog/rgba_u8_nodata.tiff"
- "../tests/fixtures/cog/rgba_u8.tif"
"#);
}
}

0 comments on commit 8d79503

Please sign in to comment.