import test from 'node:test';
import assert from 'node:assert/strict';
import { distanceMeters, routeMetrics } from '../src/services/geo.js';

test('distanceMeters liefert für identische Punkte 0', () => assert.equal(distanceMeters({ lat: 1, lon: 2 }, { lat: 1, lon: 2 }), 0));
test('routeMetrics berechnet Strecke und Höhengewinn', () => {
  const metrics = routeMetrics([{ lat: 52, lon: 13, elevation: 10 }, { lat: 52.001, lon: 13, elevation: 15 }]);
  assert.ok(metrics.distanceM > 100); assert.equal(metrics.elevationGainM, 5); assert.equal(metrics.pointCount, 2);
});
