Skip to content

Commit

Permalink
Fixes new clippy lint items-after-test-module.
Browse files Browse the repository at this point in the history
  • Loading branch information
metasim authored and lnicola committed Dec 29, 2023
1 parent 44741f6 commit 9f1ee1a
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions src/raster/rasterize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,37 +116,6 @@ impl TryFrom<RasterizeOptions> for CslStringList {
}
}

#[cfg(test)]
mod tests {
use std::convert::TryFrom;

use crate::cpl::CslStringList;

use super::RasterizeOptions;

#[test]
fn test_rasterizeoptions_as_ptr() {
let c_options = CslStringList::try_from(RasterizeOptions::default()).unwrap();
assert_eq!(
c_options.fetch_name_value("ALL_TOUCHED"),
Some("FALSE".to_string())
);
assert_eq!(c_options.fetch_name_value("BURN_VALUE_FROM"), None);
assert_eq!(
c_options.fetch_name_value("MERGE_ALG"),
Some("REPLACE".to_string())
);
assert_eq!(
c_options.fetch_name_value("CHUNKYSIZE"),
Some("0".to_string())
);
assert_eq!(
c_options.fetch_name_value("OPTIM"),
Some("AUTO".to_string())
);
}
}

/// Burn geometries into raster.
///
/// Rasterize a sequence of `gdal::vector::Geometry` onto some
Expand Down Expand Up @@ -229,3 +198,34 @@ pub fn rasterize(
}
Ok(())
}

#[cfg(test)]
mod tests {
use std::convert::TryFrom;

use crate::cpl::CslStringList;

use super::RasterizeOptions;

#[test]
fn test_rasterizeoptions_as_ptr() {
let c_options = CslStringList::try_from(RasterizeOptions::default()).unwrap();
assert_eq!(
c_options.fetch_name_value("ALL_TOUCHED"),
Some("FALSE".to_string())
);
assert_eq!(c_options.fetch_name_value("BURN_VALUE_FROM"), None);
assert_eq!(
c_options.fetch_name_value("MERGE_ALG"),
Some("REPLACE".to_string())
);
assert_eq!(
c_options.fetch_name_value("CHUNKYSIZE"),
Some("0".to_string())
);
assert_eq!(
c_options.fetch_name_value("OPTIM"),
Some("AUTO".to_string())
);
}
}

0 comments on commit 9f1ee1a

Please sign in to comment.