Files

14 lines
436 B
TypeScript

import { describe, expect, it } from 'vitest';
import { parseDms } from '../src/core/dms';
describe('parseDms', () => {
it('converts the P1 sheet string to decimal degrees (spec §12: 75.9489°)', () => {
expect(parseDms(` 75°56'55.9"`)).toBeCloseTo(75.9489, 4);
});
it('returns null for malformed strings (E03)', () => {
expect(parseDms('75.9489')).toBeNull();
expect(parseDms(`75°61'00"`)).toBeNull();
});
});