fix: Torte – große Segmente als zwei Teilbögen (A13-T3)

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-09-29 16:16:49 +02:00
co-authored by Claude Opus 5.5
parent 125d370497
commit 9e804cd349
2 changed files with 28 additions and 6 deletions
+19 -3
View File
@@ -23,10 +23,26 @@ def test_segmente_lueckenlos_und_anteile():
assert sl[0].path.startswith("M 0 0 L 0.0000 -1.0000 A 1 1 0 0 1 ")
def test_large_arc_flag():
def test_grosses_segment_als_zwei_teilboegen():
a, b = pie_slices([("A", D("70")), ("B", D("30"))])
assert " A 1 1 0 1 1 " in a.path
assert " A 1 1 0 0 1 " in b.path
assert a.path.count(" A 1 1 0 0 1 ") == 2
assert b.path.count(" A 1 1 0 0 1 ") == 1
assert " 0 1 1 " not in a.path
def test_fast_volles_segment_bleibt_sichtbar():
gross, klein = pie_slices([("Gross", D("4999.99"))], rest=D("0.01"),
rest_label="Frei verfügbar")
# Zwei Teilbögen: der Zwischenpunkt liegt gegenüber (unten), der Bogen
# kann also nie zu einem Punkt zusammenfallen.
assert gross.path.count(" A 1 1 0 0 1 ") == 2
assert " A 1 1 0 0 1 0.0000 1.0000 " in gross.path or " A 1 1 0 0 1 -0.0000 1.0000 " in gross.path
assert klein.path is not None
def test_letztes_segment_schliesst_bei_zwoelf_uhr():
sl = pie_slices([("A", D("50")), ("B", D("30")), ("C", D("20"))])
assert sl[-1].path.endswith(" 0.0000 -1.0000 Z") or sl[-1].path.endswith(" -0.0000 -1.0000 Z")
def test_einzelsegment_ist_vollkreis():