"""B03 카드 미리보기 — 노선 좌표열 솎기(2026-09-04).""" from B03_FileInput.B03_FileInput_Engine_Shapefile import _thin_preview_path def test_thin_keeps_endpoints_and_cap() -> None: part = [(float(i), float(i * 2)) for i in range(5000)] preview = _thin_preview_path([part], limit=200) assert len(preview) == 1 points = preview[0] # 상한(+ 끝점 보정 1)을 넘지 않는다. assert len(points) <= 201 assert points[0] == [0.0, 0.0] assert points[-1] == [4999.0, 9998.0] def test_thin_handles_multipart_and_empty() -> None: assert _thin_preview_path([]) == [] assert _thin_preview_path([[]]) == [] preview = _thin_preview_path([[(0.0, 0.0), (1.0, 1.0)], [(5.0, 5.0), (6.0, 6.0)]], limit=200) assert preview == [[[0.0, 0.0], [1.0, 1.0]], [[5.0, 5.0], [6.0, 6.0]]]