Skip to content

Add tests for conversions (#18)#84

Open
trasch wants to merge 1 commit into
mainfrom
18_conversion_tests
Open

Add tests for conversions (#18)#84
trasch wants to merge 1 commit into
mainfrom
18_conversion_tests

Conversation

@trasch
Copy link
Copy Markdown
Contributor

@trasch trasch commented May 8, 2026

Summary

10 new tests added to the existing ConversionTests suite (was 3, now 13).

Test Coverage
factorForUnit GISTool.factor(for:) for meters, km, miles, radians, acres
unitsFactorForUnit GISTool.unitsFactor(for:) per-meter factors
areaFactorForUnit GISTool.areaFactor(for:) per-sq-meter factors
convertLength convert(length:from:to:) meters→km, miles→m, negative→nil
convertArea convert(area:from:to:) sq-m→sq-km, sq-m→acres, negative→nil
convertToMeters Direct conversion for km, miles, cm, mm, nautical miles, inches
coordinateFromPixel coordinate(fromPixelX:pixelY:zoom:) basic round-trip
degreesFromMeters degrees(fromMeters:atLatitude:) at equator
degreesFromMetersAtPole At high latitude (converging meridians)
coordinateDegreesFromMeters Coordinate3D.degrees(fromMeters:) instance method

Test results

276 tests pass across 59 suites (+10 new).


Closes #18

10 new tests: unit/area factors, length/area conversion,
convertToMeters, pixel-to-coordinate, meters-to-degrees
at various latitudes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tests for conversions

1 participant