feat: Pruefdialog zeigt konkrete Pruefliste

- ValidationReport/ValidationCheck mit geprueft/bestanden je Kategorie
- Dialog nennt Umfang und Pruefliste statt Quellenangabe
- Kategorien: Kuerzel, Typ, Level, ChSq-Level, Features, Pflichtfeatures,
  Level aus Features, Einmal pro Programm
- Tooltip am Pruefen-Button nennt den Pruefumfang
- 54 Validierungs-Assertions, Whiteboard 237 (896 gesamt)
- Doku aktualisiert
This commit is contained in:
torsten 2026-10-31 10:18:24 +01:00
parent b788c1be04
commit b7dd88c65b
11 changed files with 545 additions and 262 deletions

View file

@ -76,27 +76,58 @@ func _test_clean_routine() -> void:
var issues := _validator.validate(routine)
_check(issues.is_empty(), "a consistent routine has no findings (%s)" % _messages(issues))
var report := _validator.validate_report(routine)
_check(report.element_count == 2, "the report counts the elements")
_check(report.section_count == 1, "the report counts the sections")
_check(report.get_check("code").passed == 2, "both codes were checked")
_check(report.get_check("type").passed == 2, "both types were checked")
_check(report.get_check("level").passed == 2, "both levels were checked")
_check(
report.get_check("fixed_level").is_skipped(),
"fixed-level check is skipped without ChSq"
)
_check(report.get_check("features").passed == 2, "both feature sets were checked")
_check(
report.get_check("required").passed == 1,
"the compulsory sequence feature was checked"
)
_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")
func _test_unknown_code() -> void:
var issues := _validate_one(
var report := _report_one(
PathSegment.ElementType.SPIN,
"3X",
0,
PackedStringArray()
)
var issues := report.issues
_check(_count(issues, ValidationIssueScript.Severity.ERROR) == 1, "unknown code is an error")
_check(_has_message(issues, "nicht im Katalog"), "unknown code message")
_check(report.get_check("code").errors == 1, "the code check records the error")
_check(
report.get_check("type").is_skipped(),
"the type check is skipped without a definition"
)
func _test_type_mismatch() -> void:
var issues := _validate_one(
var report := _report_one(
PathSegment.ElementType.SPIN,
"3Lz",
0,
PackedStringArray()
)
var issues := report.issues
_check(_count(issues, ValidationIssueScript.Severity.ERROR) == 1, "type mismatch is an error")
_check(_has_message(issues, "gehört zu Sprung"), "type mismatch message")
_check(report.get_check("code").passed == 1, "the code itself exists")
_check(report.get_check("type").errors == 1, "the type check records the mismatch")
_check(
report.get_check("level").is_skipped(),
"the level check is skipped after a type mismatch"
)
func _test_unavailable_level() -> void:
@ -128,7 +159,8 @@ func _test_jump_level_and_features() -> void:
2,
PackedStringArray(["difficult_exit"])
)
var issues := _validator.validate(routine)
var report := _validator.validate_report(routine)
var issues := report.issues
_check(
_count(issues, ValidationIssueScript.Severity.WARNING) == 2,
"jump level and features are two warnings"
@ -136,58 +168,83 @@ func _test_jump_level_and_features() -> void:
_check(_has_message(issues, "nicht levelbar"), "jump level warning")
_check(_has_message(issues, "Level-Features"), "jump feature warning")
_check(segment.element_level == 2, "the validator does not mutate the segment")
_check(
report.get_check("level").warnings == 1,
"the level check records the jump warning"
)
_check(
report.get_check("features").warnings == 1,
"the feature check records the jump warning"
)
func _test_fixed_level() -> void:
var issues := _validate_one(
var report := _report_one(
PathSegment.ElementType.SEQUENCE,
"ChSq",
2,
PackedStringArray()
)
var issues := report.issues
_check(
_count(issues, ValidationIssueScript.Severity.ERROR) == 1,
"a wrong fixed level is an error"
)
_check(_has_message(issues, "fest"), "fixed level message")
_check(report.get_check("fixed_level").errors == 1, "the fixed-level check fails")
_check(
report.get_check("level").is_skipped(),
"the generic level check is skipped for fixed levels"
)
var valid := _validate_one(
var valid := _report_one(
PathSegment.ElementType.SEQUENCE,
"ChSq",
1,
PackedStringArray()
)
_check(valid.is_empty(), "ChSq at Level 1 is valid")
_check(valid.issues.is_empty(), "ChSq at Level 1 is valid")
_check(valid.get_check("fixed_level").passed == 1, "the fixed-level check passes")
func _test_missing_code() -> void:
var issues := _validate_one(
var report := _report_one(
PathSegment.ElementType.SPIN,
"",
0,
PackedStringArray()
)
var issues := report.issues
_check(
_count(issues, ValidationIssueScript.Severity.WARNING) == 1,
"a missing code is a warning"
)
_check(_has_message(issues, "ohne Kürzel"), "missing code message")
_check(
report.get_check("code").warnings == 1,
"the code check records the missing code"
)
func _test_feature_selection() -> void:
var unknown := _validate_one(
var unknown_report := _report_one(
PathSegment.ElementType.SPIN,
"CCoSp",
0,
PackedStringArray(["nope"])
)
var unknown := unknown_report.issues
_check(
_count(unknown, ValidationIssueScript.Severity.ERROR) == 1,
"an unknown feature is an error"
)
_check(_has_message(unknown, "Unbekanntes Feature"), "unknown feature message")
_check(
unknown_report.get_check("features").errors == 1,
"the feature check records the unknown code"
)
var too_many := _validate_one(
var too_many_report := _report_one(
PathSegment.ElementType.SPIN,
"CCoSp",
0,
@ -195,37 +252,52 @@ func _test_feature_selection() -> void:
["difficult_variation", "difficult_variation", "difficult_variation"]
)
)
var too_many := too_many_report.issues
_check(
_count(too_many, ValidationIssueScript.Severity.ERROR) == 1,
"too many difficult variations is an error"
)
_check(_has_message(too_many, "zu oft"), "over-limit feature message")
var missing := _validate_one(
var missing_report := _report_one(
PathSegment.ElementType.SEQUENCE,
"StSq",
1,
PackedStringArray(["body_movements"])
)
var missing := missing_report.issues
_check(
_count(missing, ValidationIssueScript.Severity.WARNING) == 1,
"a missing compulsory sequence feature is a warning"
)
_check(_has_message(missing, "Pflichtfeature fehlt"), "compulsory feature message")
_check(
missing_report.get_check("required").warnings == 1,
"the required-feature check records the warning"
)
_check(
missing_report.get_check("level_features").is_skipped(),
"the level check is skipped when a required feature is missing"
)
func _test_level_mismatch() -> void:
var issues := _validate_one(
var report := _report_one(
PathSegment.ElementType.SPIN,
"CCoSp",
4,
PackedStringArray(["difficult_variation", "difficult_exit"])
)
var issues := report.issues
_check(
_count(issues, ValidationIssueScript.Severity.WARNING) == 1,
"a feature/level mismatch is a warning"
)
_check(_has_message(issues, "Features ergeben"), "level mismatch message")
_check(
report.get_check("level_features").warnings == 1,
"the derived-level check records the mismatch"
)
func _test_program_once_features() -> void:
@ -247,7 +319,8 @@ func _test_program_once_features() -> void:
1,
PackedStringArray(["difficult_exit"])
)
var issues := _validator.validate(routine)
var report := _validator.validate_report(routine)
var issues := report.issues
_check(
_count(issues, ValidationIssueScript.Severity.WARNING) == 1,
"repeated once-per-program features warn once per repeated occurrence"
@ -257,6 +330,11 @@ func _test_program_once_features() -> void:
_has_message(issues, "zuerst in Segment „spin-a“"),
"once-per-program message names the first segment"
)
_check(
report.get_check("once").passed == 1
and report.get_check("once").warnings == 1,
"the once-per-program check counts both occurrences"
)
func _test_missing_rules() -> void:
@ -283,9 +361,18 @@ func _validate_one(
level: int,
features: PackedStringArray
) -> Array[ValidationIssue]:
return _report_one(type, code, level, features).issues
func _report_one(
type: PathSegment.ElementType,
code: String,
level: int,
features: PackedStringArray
) -> ValidationReport:
var routine := _make_routine()
_add_marker(routine.sections[0], "segment", type, code, level, features)
return _validator.validate(routine)
return _validator.validate_report(routine)
func _make_routine() -> Routine:

View file

@ -1126,18 +1126,18 @@ func _run() -> void:
"validation dialog shows the catalog finding"
)
_check(
controller.validation_text.text.contains("Katalog 2025/26")
and controller.validation_text.text.contains("2707"),
"validation dialog names the catalog and its source"
controller.validation_text.text.contains("Geprüft: 1 Element in 1 Abschnitt")
and controller.validation_text.text.contains("Saison 2025/26"),
"validation dialog states the scope of the check"
)
_check(
controller.validation_text.text.contains("Level-Regeln 2025/26")
and controller.validation_text.text.contains("2701"),
"validation dialog names the level rules and their source"
controller.validation_text.text.contains("Kürzel im Katalog")
and controller.validation_text.text.contains("0/1"),
"validation dialog lists the failed check with its count"
)
_check(
controller.validation_text.text.contains("1 Element geprüft"),
"validation dialog reports how many elements were checked"
controller.validation_text.text.contains("Befunde"),
"validation dialog separates checks from findings"
)
controller.validation_dialog.hide()
@ -1156,8 +1156,9 @@ func _run() -> void:
controller.open_validation_dialog()
_check(
controller.validation_text.text.contains("Keine Befunde")
and controller.validation_text.text.contains("Das Element passt"),
"clean validation names the rule set and the checked element count"
and controller.validation_text.text.contains("Kürzel im Katalog")
and controller.validation_text.text.contains("1/1"),
"clean validation lists the passed checks"
)
controller.validation_dialog.hide()