From 3dbc42febb251fc5430e720b6b10e7cdd8c18b5e Mon Sep 17 00:00:00 2001 From: Gaurav Atreya Date: Tue, 2 Jan 2024 16:45:16 -0500 Subject: [PATCH] Fix: modify test for shp.zip only for gdal v 3.1 onwards --- src/driver.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/driver.rs b/src/driver.rs index 5ba9627e..0f33da34 100644 --- a/src/driver.rs +++ b/src/driver.rs @@ -562,15 +562,19 @@ mod tests { .map(|d| d.short_name()) .collect::>() }; + 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")); + // `shp.zip` only supported from gdal version 3.1 + // https://gdal.org/drivers/vector/shapefile.html#compressed-files + 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")); }