feat: Basiswert-Schaetzung im Pruefdialog

- ValidationReport summiert Base Values und zaehlt gewertete sowie nicht
  gewertete Elemente
- Wertungsliste pro Element inkl. nicht gewerteter Freitext-Codes
- Dialog zeigt Basiswert, Zaehler, Caveat und Wertungsliste
- 63 Validierungs- und 262 Whiteboard-Assertions (930 gesamt)
- Doku, Findings und Roadmap aktualisiert
This commit is contained in:
torsten 2026-10-31 10:55:27 +01:00
parent 15f7eab9cf
commit 334603c810
9 changed files with 230 additions and 9 deletions

View file

@ -93,6 +93,17 @@ func _test_clean_routine() -> void:
)
_check(report.get_check("level_features").passed == 2, "both derived levels match")
_check(report.get_check("once").passed == 6, "once-per-program features were checked")
_check_approx(
report.base_value_total,
7.40,
"the report sums the base values (3.50 + 3.90)"
)
_check(report.scored_elements == 2, "both elements were scored")
_check(report.unscored_elements == 0, "no element is unscored")
_check(
report.element_values.size() == 2,
"the report keeps one value entry per element"
)
func _test_unknown_code() -> void:
@ -110,6 +121,13 @@ func _test_unknown_code() -> void:
report.get_check("type").is_skipped(),
"the type check is skipped without a definition"
)
_check(report.unscored_elements == 1, "an unknown code has no base value")
_check(report.base_value_total == 0.0, "an unknown code adds no points")
_check(
report.element_values.size() == 1
and float(report.element_values[0]["value"]) < 0.0,
"the score entry marks the unknown code as unscored"
)
func _test_type_mismatch() -> void:
@ -176,6 +194,11 @@ func _test_jump_level_and_features() -> void:
report.get_check("features").warnings == 1,
"the feature check records the jump warning"
)
_check_approx(
report.base_value_total,
5.90,
"the jump contributes its base value despite the level warning"
)
func _test_fixed_level() -> void:
@ -205,6 +228,7 @@ func _test_fixed_level() -> void:
)
_check(valid.issues.is_empty(), "ChSq at Level 1 is valid")
_check(valid.get_check("fixed_level").passed == 1, "the fixed-level check passes")
_check_approx(valid.base_value_total, 3.00, "ChSq contributes 3.00")
func _test_missing_code() -> void:
@ -431,6 +455,13 @@ func _check(condition: bool, message: String) -> void:
_failures.append(message)
func _check_approx(actual: float, expected: float, message: String) -> void:
_check(
absf(actual - expected) <= 0.001,
"%s (expected %.3f, got %.3f)" % [message, expected, actual]
)
func _finish() -> void:
if _failures.is_empty():
print("PASS: %d assertions" % _assertions)

View file

@ -1268,6 +1268,17 @@ func _run() -> void:
),
"skipped checks explain why they do not apply"
)
_check(
controller.validation_text.text.contains("Basiswert")
and controller.validation_text.text.contains("0,00")
and controller.validation_text.text.contains("1 ohne Base Value"),
"validation dialog shows the base-value total and unscored count"
)
_check(
controller.validation_text.text.contains("Wertung")
and controller.validation_text.text.contains("3X — —"),
"the scoring breakdown marks unknown elements as unscored"
)
controller.validation_dialog.hide()
controller.new_routine()
@ -1289,6 +1300,11 @@ func _run() -> void:
and controller.validation_text.text.contains("1/1"),
"clean validation lists the passed checks"
)
_check(
controller.validation_text.text.contains("Basiswert")
and controller.validation_text.text.contains("1,70"),
"clean validation shows the base value of a Base spin"
)
controller.validation_dialog.hide()
scene.queue_free()