diff --git a/.gitignore b/.gitignore index 3b29812..311d862 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,7 @@ DerivedData/ .swiftpm/config/registries.json .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata .netrc + +.claude +.vscode +.zed diff --git a/Tests/GeoDrawerTests/GeoDrawerSVGZoomTests.swift b/Tests/GeoDrawerTests/GeoDrawerSVGZoomTests.swift new file mode 100644 index 0000000..9c126cd --- /dev/null +++ b/Tests/GeoDrawerTests/GeoDrawerSVGZoomTests.swift @@ -0,0 +1,145 @@ +#if canImport(Testing) + +import Testing +import Foundation +#if canImport(CoreGraphics) +import CoreGraphics +#endif + +import GeoJSONKit +@testable import GeoDrawer +@testable import GeoProjector + +struct GeoDrawerSVGZoomTests { + + @Test func testSVGWithoutZoom() throws { + let drawer = GeoDrawer( + size: .init(width: 400, height: 200), + projection: Projections.Equirectangular() + ) + + let line = GeoJSON.LineString(positions: [ + .init(latitude: 40, longitude: -120), // West coast US + .init(latitude: 40, longitude: -80) // East coast US + ]) + + let content: [GeoDrawer.Content] = [ + .line(line, stroke: testColor(red: 1, green: 0, blue: 0), strokeWidth: 2) + ] + + let svg = drawer.drawSVG(content) + + // Just verify the basic structure and that it contains the expected line + #expect(svg.contains(" GeoDrawer.Color + { + #if canImport(CoreGraphics) + return CGColor(red: red, green: green, blue: blue, alpha: alpha) + #else + return GeoDrawer.Color(red: red, green: green, blue: blue, alpha: alpha) + #endif + } +} + +#endif // canImport(Testing)