Skip to content

Commit

Permalink
Fix: modify test for shp.zip only for gdal v 3.1 onwards
Browse files Browse the repository at this point in the history
  • Loading branch information
Atreyagaurav committed Jan 2, 2024
1 parent 62f7ccd commit 12ebe8a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -562,15 +562,17 @@ mod tests {
.map(|d| d.short_name())
.collect::<HashSet<String>>()
};
let gdal_version: i64 = crate::version::version_info("VERSION_NUM").parse().unwrap();
if DriverManager::get_driver_by_name("ESRI Shapefile").is_ok() {
assert!(drivers("test.shp", true).contains("ESRI Shapefile"));
assert!(drivers("test.shp.zip", true).contains("ESRI Shapefile"));
if gdal_version >= 3010000 {
assert!(drivers("test.shp.zip", true).contains("ESRI Shapefile"));
}
}
if DriverManager::get_driver_by_name("GPKG").is_ok() {
assert!(drivers("test.gpkg", true).contains("GPKG"));
// `gpkg.zip` only supported from gdal version 3.7
// https://gdal.org/drivers/vector/gpkg.html#compressed-files
let gdal_version: i64 = crate::version::version_info("VERSION_NUM").parse().unwrap();
if gdal_version >= 3070000 {
assert!(drivers("test.gpkg.zip", true).contains("GPKG"));
}
Expand Down

0 comments on commit 12ebe8a

Please sign in to comment.