feat: ISU 2026/27 und Adult-Kategorien
- SoV 2026/27 (Communication 2786) und Levels 2026/27 (2788) - 15 Pirouetten- und 5 Sequenz-Features, Windmills, neues ChSp1 - Adult-Kategorien Gold/Silver/Bronze plus Masters/Elite aus dem IAFSC-Announcement 2026/27 - Kategorie-Auswahl in der Statusleiste und Kategorie-Validierung (Sprunganzahl, erlaubte Sprünge, Level-Caps, Pflichtelemente) - 60 Adult-Assertions; gesamt 1012 Assertions gruen - Doku, Findings und Roadmap aktualisiert
This commit is contained in:
parent
531a057168
commit
e4fd74ea6e
25 changed files with 1930 additions and 119 deletions
|
|
@ -30,6 +30,9 @@ $GODOT --headless --path rinkplanner --script res://tests/run_level_tests.gd
|
|||
# Run routine element-validation tests
|
||||
$GODOT --headless --path rinkplanner --script res://tests/run_validation_tests.gd
|
||||
|
||||
# Run adult category tests
|
||||
$GODOT --headless --path rinkplanner --script res://tests/run_adult_tests.gd
|
||||
|
||||
# Run canvas transform/geometry tests
|
||||
$GODOT --headless --path rinkplanner --script res://tests/run_canvas_tests.gd
|
||||
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ func _capture() -> void:
|
|||
controller.element_button.pressed.emit()
|
||||
elif args.size() > 3 and args[3] == "validate":
|
||||
controller.open_validation_dialog()
|
||||
elif args.size() > 3 and args[3] == "adultgold":
|
||||
controller.set_adult_category("gold")
|
||||
controller.open_validation_dialog()
|
||||
elif args.size() > 3 and args[3] == "scoreinfo":
|
||||
controller.open_validation_dialog()
|
||||
controller.validation_text.meta_clicked.emit("score_info")
|
||||
|
|
|
|||
274
rinkplanner/tests/run_adult_tests.gd
Normal file
274
rinkplanner/tests/run_adult_tests.gd
Normal file
|
|
@ -0,0 +1,274 @@
|
|||
extends SceneTree
|
||||
|
||||
## Headless tests for the 2026/27 adult category rules and their validation.
|
||||
##
|
||||
## Run with:
|
||||
## godot --headless --path rinkplanner --script res://tests/run_adult_tests.gd
|
||||
|
||||
const ElementCatalogScript := preload("res://src/core/rules/element_catalog.gd")
|
||||
const ElementLevelRulesScript := preload("res://src/core/rules/element_level_rules.gd")
|
||||
const AdultCategoryRulesScript := preload("res://src/core/rules/adult_category_rules.gd")
|
||||
const RoutineValidatorScript := preload("res://src/core/rules/routine_validator.gd")
|
||||
const RoutineModel := preload("res://src/core/model/routine.gd")
|
||||
const RoutineSectionModel := preload("res://src/core/model/routine_section.gd")
|
||||
const PathSegmentModel := preload("res://src/core/model/path_segment.gd")
|
||||
|
||||
var _assertions: int = 0
|
||||
var _failures: PackedStringArray = PackedStringArray()
|
||||
var _catalog: ElementCatalog
|
||||
var _rules: ElementLevelRules
|
||||
var _adult: AdultCategoryRules
|
||||
var _validator: RoutineValidator
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
_catalog = ElementCatalogScript.load_default()
|
||||
_rules = ElementLevelRulesScript.load_default()
|
||||
_adult = AdultCategoryRulesScript.load_default()
|
||||
_validator = RoutineValidatorScript.new(_catalog, _rules, _adult)
|
||||
|
||||
_test_metadata()
|
||||
_test_category_fields()
|
||||
_test_jump_permissions()
|
||||
_test_gold_limits()
|
||||
_test_valid_gold()
|
||||
_test_unknown_category()
|
||||
_finish()
|
||||
|
||||
|
||||
func _test_metadata() -> void:
|
||||
_check(_adult.is_valid(), "adult rules are valid")
|
||||
_check(_adult.season == "2026/27", "adult rules season is 2026/27")
|
||||
_check(_adult.source.contains("Adult"), "adult rules name the adult announcement")
|
||||
_check(
|
||||
_adult.get_categories().size() == 5,
|
||||
"five adult categories are available"
|
||||
)
|
||||
_check(_adult.has_category("gold"), "Gold category exists")
|
||||
_check(_adult.has_category("silver"), "Silver category exists")
|
||||
_check(_adult.has_category("bronze"), "Bronze category exists")
|
||||
|
||||
|
||||
func _test_category_fields() -> void:
|
||||
var gold := _adult.get_category("gold")
|
||||
_check(gold.duration_seconds == 170, "Gold lasts 2:50")
|
||||
_check(gold.max_jump_elements == 5, "Gold allows five jump elements")
|
||||
_check(gold.max_spins == 3, "Gold allows three spins")
|
||||
_check(gold.max_step_sequences == 1, "Gold allows one step sequence")
|
||||
_check(gold.max_choreographic_sequences == 0, "Gold has no choreo sequence")
|
||||
_check(gold.requires_choreographic_spin, "Gold requires a choreographic spin")
|
||||
_check(gold.max_spin_level == 3, "Gold caps spins at Level 3")
|
||||
_check(gold.max_sequence_level == 2, "Gold caps sequences at Level 2")
|
||||
_check_approx(gold.pcs_factor, 2.67, "Gold PCS factor")
|
||||
_check_approx(gold.fall_deduction, 1.0, "Gold fall deduction")
|
||||
|
||||
var silver := _adult.get_category("silver")
|
||||
_check(silver.duration_seconds == 120, "Silver lasts 2:00")
|
||||
_check(silver.max_spins == 2, "Silver allows two spins")
|
||||
_check(silver.max_choreographic_sequences == 1, "Silver uses a choreo sequence")
|
||||
_check(not silver.requires_choreographic_spin, "Silver needs no choreo spin")
|
||||
_check(silver.max_spin_level == 2, "Silver caps spins at Level 2")
|
||||
_check_approx(silver.pcs_factor, 2.0, "Silver PCS factor")
|
||||
|
||||
var bronze := _adult.get_category("bronze")
|
||||
_check(bronze.duration_seconds == 100, "Bronze lasts 1:40")
|
||||
_check(not bronze.allow_axel, "Bronze forbids Axel jumps")
|
||||
_check(bronze.max_jump_combinations == 1, "Bronze allows one jump combination")
|
||||
_check(bronze.max_spin_level == 1, "Bronze caps spins at Level 1")
|
||||
|
||||
|
||||
func _test_jump_permissions() -> void:
|
||||
var bronze := _adult.get_category("bronze")
|
||||
_check(bronze.is_jump_allowed("1T"), "Bronze allows 1T")
|
||||
_check(not bronze.is_jump_allowed("1A"), "Bronze forbids 1A")
|
||||
_check(not bronze.is_jump_allowed("2T"), "Bronze forbids doubles")
|
||||
|
||||
var silver := _adult.get_category("silver")
|
||||
_check(silver.is_jump_allowed("1A"), "Silver allows 1A")
|
||||
_check(not silver.is_jump_allowed("2T"), "Silver forbids doubles")
|
||||
|
||||
var gold := _adult.get_category("gold")
|
||||
_check(gold.is_jump_allowed("1A"), "Gold allows 1A")
|
||||
_check(gold.is_jump_allowed("2T"), "Gold allows 2T")
|
||||
_check(not gold.is_jump_allowed("2Lz"), "Gold forbids 2Lz")
|
||||
_check(not gold.is_jump_allowed("2A"), "Gold forbids 2A")
|
||||
_check(not gold.is_jump_allowed("3T"), "Gold forbids triples")
|
||||
|
||||
var masters := _adult.get_category("masters")
|
||||
_check(masters.is_jump_allowed("2A"), "Masters allows 2A")
|
||||
_check(not masters.is_jump_allowed("3T"), "Masters forbids triples")
|
||||
|
||||
var elite := _adult.get_category("masters_elite")
|
||||
_check(elite.is_jump_allowed("3T"), "Masters Elite allows triples")
|
||||
_check(not elite.is_jump_allowed("4T"), "Masters Elite forbids quads")
|
||||
|
||||
|
||||
func _test_gold_limits() -> void:
|
||||
var routine := _make_routine("gold")
|
||||
var section := routine.sections[0]
|
||||
for code: String in ["1T", "1S", "1Lo", "2T", "2S", "3T"]:
|
||||
_add_jump(section, code)
|
||||
for index: int in range(4):
|
||||
_add_spin(section, "spin-%d" % index, "CCoSp", 4)
|
||||
_add_sequence(section, "step", "StSq", 3)
|
||||
|
||||
var report := _validator.validate_report(routine)
|
||||
_check(
|
||||
report.get_check("category").passed == 1,
|
||||
"the category itself is recognised"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_jumps").warnings == 1,
|
||||
"six jumps exceed the Gold limit"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_jump_types").warnings == 1,
|
||||
"3T is not allowed in Gold"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_spins").warnings == 1,
|
||||
"four spins exceed the Gold limit"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_levels").warnings == 1,
|
||||
"Level 4 exceeds the Gold level caps"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_required").warnings == 1,
|
||||
"the missing choreographic spin is reported"
|
||||
)
|
||||
_check(_has_message(report, "Sprungelemente: 6"), "jump count message")
|
||||
_check(_has_message(report, "„3T“ ist in Gold nicht erlaubt"), "forbidden jump message")
|
||||
_check(_has_message(report, "Pirouetten: 4"), "spin count message")
|
||||
_check(_has_message(report, "max. Level 3"), "spin level cap message")
|
||||
_check(_has_message(report, "Choreographic Spin"), "choreo spin message")
|
||||
|
||||
|
||||
func _test_valid_gold() -> void:
|
||||
var routine := _make_routine("gold")
|
||||
var section := routine.sections[0]
|
||||
for code: String in ["1A", "2T", "2S"]:
|
||||
_add_jump(section, code)
|
||||
_add_spin(section, "spin-a", "CCoSp", 3)
|
||||
_add_spin(section, "spin-b", "FUSp", 3)
|
||||
_add_spin(section, "spin-chsp", "ChSp", 1)
|
||||
_add_sequence(section, "step", "StSq", 2)
|
||||
|
||||
var report := _validator.validate_report(routine)
|
||||
_check(report.issues.is_empty(), "a valid Gold program has no findings")
|
||||
_check(
|
||||
report.get_check("category_jumps").passed == 1,
|
||||
"the Gold jump count passes"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_spins").passed == 1,
|
||||
"the Gold spin count passes"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_sequences").passed == 1,
|
||||
"the Gold sequence count passes"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_levels").passed == 1,
|
||||
"the Gold level caps pass"
|
||||
)
|
||||
_check(
|
||||
report.get_check("category_required").passed == 1,
|
||||
"the Gold required elements pass"
|
||||
)
|
||||
|
||||
|
||||
func _test_unknown_category() -> void:
|
||||
var routine := _make_routine("unknown")
|
||||
var report := _validator.validate_report(routine)
|
||||
_check(report.get_check("category").errors == 1, "an unknown category is an error")
|
||||
_check(_has_message(report, "Unbekannte Adult-Kategorie"), "unknown category message")
|
||||
|
||||
|
||||
func _make_routine(category: String) -> Routine:
|
||||
var routine: Routine = RoutineModel.new()
|
||||
routine.routine_id = "adult-test"
|
||||
routine.title = "Adult"
|
||||
routine.adult_category = category
|
||||
var section: RoutineSection = RoutineSectionModel.new()
|
||||
section.section_id = "section-001"
|
||||
section.title = "Abschnitt 1"
|
||||
section.sequence_order = 0
|
||||
var sections: Array[RoutineSection] = [section]
|
||||
routine.sections = sections
|
||||
return routine
|
||||
|
||||
|
||||
func _add_jump(section: RoutineSection, code: String) -> PathSegment:
|
||||
var segment: PathSegment = PathSegmentModel.new()
|
||||
segment.segment_id = "jump-%d" % section.segments.size()
|
||||
segment.curve = _make_point_curve(Vector2.ZERO)
|
||||
segment.set_element(PathSegment.ElementType.JUMP, code, 0)
|
||||
section.segments.append(segment)
|
||||
return segment
|
||||
|
||||
|
||||
func _add_spin(
|
||||
section: RoutineSection,
|
||||
segment_id: String,
|
||||
code: String,
|
||||
level: int
|
||||
) -> PathSegment:
|
||||
var segment: PathSegment = PathSegmentModel.new()
|
||||
segment.segment_id = segment_id
|
||||
segment.curve = _make_point_curve(Vector2.ZERO)
|
||||
segment.set_element(PathSegment.ElementType.SPIN, code, level)
|
||||
section.segments.append(segment)
|
||||
return segment
|
||||
|
||||
|
||||
func _add_sequence(
|
||||
section: RoutineSection,
|
||||
segment_id: String,
|
||||
code: String,
|
||||
level: int
|
||||
) -> PathSegment:
|
||||
var segment: PathSegment = PathSegmentModel.new()
|
||||
segment.segment_id = segment_id
|
||||
segment.curve = _make_point_curve(Vector2.ZERO)
|
||||
segment.set_element(PathSegment.ElementType.SEQUENCE, code, level)
|
||||
section.segments.append(segment)
|
||||
return segment
|
||||
|
||||
|
||||
func _make_point_curve(point: Vector2) -> Curve2D:
|
||||
var curve := Curve2D.new()
|
||||
curve.add_point(point)
|
||||
return curve
|
||||
|
||||
|
||||
func _has_message(report: ValidationReport, fragment: String) -> bool:
|
||||
for issue: ValidationIssue in report.issues:
|
||||
if issue.message.contains(fragment):
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _check(condition: bool, message: String) -> void:
|
||||
_assertions += 1
|
||||
if not condition:
|
||||
_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)
|
||||
quit(0)
|
||||
return
|
||||
|
||||
for failure: String in _failures:
|
||||
printerr("FAIL: %s" % failure)
|
||||
printerr("%d of %d assertions failed" % [_failures.size(), _assertions])
|
||||
quit(1)
|
||||
1
rinkplanner/tests/run_adult_tests.gd.uid
Normal file
1
rinkplanner/tests/run_adult_tests.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bgwttvsrlquvj
|
||||
|
|
@ -32,16 +32,16 @@ func _test_rules_metadata() -> void:
|
|||
"level rules parse without errors (%s)" % ", ".join(_rules.get_errors())
|
||||
)
|
||||
_check(_rules.is_valid(), "level rules are valid")
|
||||
_check(_rules.season == "2025/26", "level rules season is 2025/26")
|
||||
_check(_rules.source.contains("2701"), "level rules name ISU communication 2701")
|
||||
_check(_rules.valid_from == "2025-07-01", "level rules valid from 2025-07-01")
|
||||
_check(_rules.season == "2026/27", "level rules season is 2026/27")
|
||||
_check(_rules.source.contains("2788"), "level rules name ISU communication 2788")
|
||||
_check(_rules.valid_from == "2026-06-01", "level rules valid from 2026-06-01")
|
||||
_check(
|
||||
_rules.get_features(PathSegment.ElementType.SPIN).size() == 14,
|
||||
"spin rules contain 14 features"
|
||||
_rules.get_features(PathSegment.ElementType.SPIN).size() == 15,
|
||||
"spin rules contain 15 features"
|
||||
)
|
||||
_check(
|
||||
_rules.get_features(PathSegment.ElementType.SEQUENCE).size() == 4,
|
||||
"sequence rules contain 4 features"
|
||||
_rules.get_features(PathSegment.ElementType.SEQUENCE).size() == 5,
|
||||
"sequence rules contain 5 features"
|
||||
)
|
||||
_check(
|
||||
_rules.get_features(PathSegment.ElementType.JUMP).is_empty(),
|
||||
|
|
@ -198,6 +198,22 @@ func _test_fixed_and_unlevelled_elements() -> void:
|
|||
).level == 0,
|
||||
"a fixed level only applies to the matching element type"
|
||||
)
|
||||
var chsp := _rules.calculate_level(
|
||||
PathSegment.ElementType.SPIN,
|
||||
"ChSp",
|
||||
PackedStringArray()
|
||||
)
|
||||
_check(chsp.level == 1, "ChSp is fixed at Level 1")
|
||||
var chsp_with_features := _rules.calculate_level(
|
||||
PathSegment.ElementType.SPIN,
|
||||
"ChSp1",
|
||||
PackedStringArray(["difficult_exit"])
|
||||
)
|
||||
_check(chsp_with_features.level == 1, "ChSp ignores feature selections")
|
||||
_check(
|
||||
_rules.get_fixed_level(PathSegment.ElementType.SPIN, "ChSp") == 1,
|
||||
"ChSp exposes its fixed level"
|
||||
)
|
||||
|
||||
var jump := _rules.calculate_level(
|
||||
PathSegment.ElementType.JUMP,
|
||||
|
|
@ -254,10 +270,16 @@ func _test_feature_validation() -> void:
|
|||
== PackedStringArray(["variety_of_turns"]),
|
||||
"required sequence features are exposed"
|
||||
)
|
||||
var level4_features := _rules.get_level4_features(spins)
|
||||
_check(
|
||||
_rules.get_level4_features(spins).size() == 6,
|
||||
level4_features.size() == 6,
|
||||
"six spin features unlock Level 4"
|
||||
)
|
||||
_check(
|
||||
level4_features.has("windmills")
|
||||
and not level4_features.has("difficult_position_change"),
|
||||
"the 2026/27 Level-4 list contains windmills instead of the position change"
|
||||
)
|
||||
|
||||
|
||||
func _test_segment_features() -> void:
|
||||
|
|
|
|||
|
|
@ -35,17 +35,17 @@ func _test_catalog_metadata() -> void:
|
|||
"catalog parses without errors (%s)" % ", ".join(_catalog.get_errors())
|
||||
)
|
||||
_check(_catalog.is_valid(), "catalog is valid")
|
||||
_check(_catalog.season == "2025/26", "catalog season is 2025/26")
|
||||
_check(_catalog.source.contains("2707"), "catalog names ISU communication 2707")
|
||||
_check(_catalog.valid_from == "2025-07-01", "catalog valid from 2025-07-01")
|
||||
_check(_catalog.get_definition_count() == 42, "catalog has 42 element families")
|
||||
_check(_catalog.season == "2026/27", "catalog season is 2026/27")
|
||||
_check(_catalog.source.contains("2786"), "catalog names ISU communication 2786")
|
||||
_check(_catalog.valid_from == "2026-07-01", "catalog valid from 2026-07-01")
|
||||
_check(_catalog.get_definition_count() == 43, "catalog has 43 element families")
|
||||
_check(
|
||||
_catalog.get_codes(PathSegment.ElementType.JUMP).size() == 24,
|
||||
"catalog has 24 jump families"
|
||||
)
|
||||
_check(
|
||||
_catalog.get_codes(PathSegment.ElementType.SPIN).size() == 16,
|
||||
"catalog has 16 spin families"
|
||||
_catalog.get_codes(PathSegment.ElementType.SPIN).size() == 17,
|
||||
"catalog has 17 spin families"
|
||||
)
|
||||
_check(
|
||||
_catalog.get_codes(PathSegment.ElementType.SEQUENCE).size() == 2,
|
||||
|
|
@ -93,22 +93,37 @@ func _test_jump_values() -> void:
|
|||
|
||||
|
||||
func _test_spin_values() -> void:
|
||||
_check_approx(_catalog.get_base_value("USpB"), 1.00, "USpB base value")
|
||||
_check_approx(_catalog.get_base_value("USp4"), 2.40, "USp4 base value")
|
||||
_check_approx(_catalog.get_base_value("LSp4"), 2.70, "LSp4 base value")
|
||||
_check_approx(_catalog.get_base_value("FCSp4"), 3.20, "FCSp4 base value")
|
||||
_check_approx(_catalog.get_base_value("CCoSpB"), 1.70, "CCoSpB base value")
|
||||
_check_approx(_catalog.get_base_value("CCoSp4"), 3.50, "CCoSp4 base value")
|
||||
_check_approx(_catalog.get_base_value("USpB"), 1.20, "USpB base value")
|
||||
_check_approx(_catalog.get_base_value("USp4"), 2.90, "USp4 base value")
|
||||
_check_approx(_catalog.get_base_value("LSp4"), 3.20, "LSp4 base value")
|
||||
_check_approx(_catalog.get_base_value("FCSp4"), 3.80, "FCSp4 base value")
|
||||
_check_approx(_catalog.get_base_value("CCoSpB"), 2.00, "CCoSpB base value")
|
||||
_check_approx(_catalog.get_base_value("CCoSp4"), 4.20, "CCoSp4 base value")
|
||||
_check_approx(
|
||||
_catalog.get_base_value("CCoSp", 4),
|
||||
3.50,
|
||||
4.20,
|
||||
"spin lookup by family and level"
|
||||
)
|
||||
_check_approx(
|
||||
_catalog.get_base_value("CCoSp4", -1),
|
||||
3.50,
|
||||
4.20,
|
||||
"spin lookup infers the level suffix"
|
||||
)
|
||||
_check_approx(
|
||||
_catalog.get_base_value("ChSp1"),
|
||||
3.50,
|
||||
"ChSp1 base value"
|
||||
)
|
||||
var choreo_spin := _catalog.find("ChSp")
|
||||
_check(
|
||||
choreo_spin != null
|
||||
and choreo_spin.element_type == PathSegment.ElementType.SPIN,
|
||||
"ChSp is a spin family"
|
||||
)
|
||||
_check(
|
||||
choreo_spin.get_codes() == PackedStringArray(["ChSp1"]),
|
||||
"ChSp has only its fixed canonical level"
|
||||
)
|
||||
|
||||
var combination: ElementDefinition = _catalog.find("CCoSp")
|
||||
_check(combination != null, "CCoSp family exists")
|
||||
|
|
@ -129,12 +144,12 @@ func _test_spin_values() -> void:
|
|||
|
||||
|
||||
func _test_sequence_values() -> void:
|
||||
_check_approx(_catalog.get_base_value("StSqB"), 1.50, "StSqB base value")
|
||||
_check_approx(_catalog.get_base_value("StSq3"), 3.30, "StSq3 base value")
|
||||
_check_approx(_catalog.get_base_value("ChSq1"), 3.00, "ChSq1 base value")
|
||||
_check_approx(_catalog.get_base_value("StSqB"), 1.60, "StSqB base value")
|
||||
_check_approx(_catalog.get_base_value("StSq3"), 3.50, "StSq3 base value")
|
||||
_check_approx(_catalog.get_base_value("ChSq1"), 3.50, "ChSq1 base value")
|
||||
_check_approx(
|
||||
_catalog.get_base_value("ChSq"),
|
||||
3.00,
|
||||
3.50,
|
||||
"single-level sequence resolves without a suffix"
|
||||
)
|
||||
_check_approx(
|
||||
|
|
@ -170,17 +185,17 @@ func _test_lookup_rules() -> void:
|
|||
)
|
||||
_check_approx(
|
||||
_catalog.get_base_value("CCoSp4", 2),
|
||||
3.50,
|
||||
4.20,
|
||||
"a canonical suffix wins over the level argument"
|
||||
)
|
||||
_check_approx(
|
||||
_catalog.get_base_value("StSqB", 4),
|
||||
1.50,
|
||||
1.60,
|
||||
"a Base suffix wins over a graded level argument"
|
||||
)
|
||||
_check_approx(
|
||||
_catalog.get_base_value("ChSq1", 0),
|
||||
3.00,
|
||||
3.50,
|
||||
"an explicit sequence suffix wins over level 0"
|
||||
)
|
||||
_check_approx(
|
||||
|
|
@ -230,10 +245,20 @@ func _test_segment_integration() -> void:
|
|||
spin.set_element(PathSegment.ElementType.SPIN, "CCoSp", 4)
|
||||
_check_approx(
|
||||
_catalog.get_segment_base_value(spin),
|
||||
3.50,
|
||||
4.20,
|
||||
"segment integration resolves a spin"
|
||||
)
|
||||
|
||||
var choreo_spin: PathSegment = PathSegmentModel.new()
|
||||
choreo_spin.segment_id = "choreo-spin"
|
||||
choreo_spin.curve = _make_point_curve(Vector2.ZERO)
|
||||
choreo_spin.set_element(PathSegment.ElementType.SPIN, "ChSp", 1)
|
||||
_check_approx(
|
||||
_catalog.get_segment_base_value(choreo_spin),
|
||||
3.50,
|
||||
"segment integration resolves a choreographic spin"
|
||||
)
|
||||
|
||||
var jump: PathSegment = PathSegmentModel.new()
|
||||
jump.segment_id = "jump"
|
||||
jump.curve = _make_point_curve(Vector2.ZERO)
|
||||
|
|
@ -250,7 +275,7 @@ func _test_segment_integration() -> void:
|
|||
sequence.set_element(PathSegment.ElementType.SEQUENCE, "StSq", 3)
|
||||
_check_approx(
|
||||
_catalog.get_segment_base_value(sequence),
|
||||
3.30,
|
||||
3.50,
|
||||
"segment integration resolves a sequence"
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ func _test_clean_routine() -> void:
|
|||
_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)"
|
||||
8.30,
|
||||
"the report sums the base values (4.20 + 4.10)"
|
||||
)
|
||||
_check(report.scored_elements == 2, "both elements were scored")
|
||||
_check(report.unscored_elements == 0, "no element is unscored")
|
||||
|
|
@ -228,7 +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")
|
||||
_check_approx(valid.base_value_total, 3.50, "ChSq contributes 3.50")
|
||||
|
||||
|
||||
func _test_missing_code() -> void:
|
||||
|
|
|
|||
|
|
@ -799,9 +799,9 @@ func _run() -> void:
|
|||
"the level is read-only for a catalog spin"
|
||||
)
|
||||
var catalog := controller.get_element_catalog()
|
||||
_check(catalog != null and catalog.season == "2025/26", "controller loads the ISU catalog")
|
||||
_check(catalog != null and catalog.season == "2026/27", "controller loads the ISU catalog")
|
||||
_check(
|
||||
controller.element_value_label.text.contains("3,50"),
|
||||
controller.element_value_label.text.contains("4,20"),
|
||||
"element dialog shows the base value of the current code and level"
|
||||
)
|
||||
|
||||
|
|
@ -820,7 +820,7 @@ func _run() -> void:
|
|||
)
|
||||
controller.update_element_value_hint()
|
||||
_check(
|
||||
controller.element_value_label.text.contains("2,50"),
|
||||
controller.element_value_label.text.contains("3,00"),
|
||||
"base value follows the derived level 2"
|
||||
)
|
||||
|
||||
|
|
@ -830,7 +830,7 @@ func _run() -> void:
|
|||
"free-text mode shows the text field"
|
||||
)
|
||||
_check(
|
||||
controller.element_value_label.text.contains("3,50"),
|
||||
controller.element_value_label.text.contains("4,20"),
|
||||
"a canonical suffix wins over the derived level"
|
||||
)
|
||||
|
||||
|
|
@ -864,8 +864,8 @@ func _run() -> void:
|
|||
"feature menu populates for a spin"
|
||||
)
|
||||
_check(
|
||||
controller.element_feature_menu.item_count == 17,
|
||||
"feature menu lists 14 features plus the second difficult variation"
|
||||
controller.element_feature_menu.item_count == 18,
|
||||
"feature menu lists 15 features plus the second difficult variation"
|
||||
)
|
||||
_check(
|
||||
controller.element_feature_menu.get_item_metadata(0) == "difficult_variation",
|
||||
|
|
@ -1249,7 +1249,7 @@ func _run() -> void:
|
|||
)
|
||||
_check(
|
||||
controller.validation_text.text.contains("Geprüft: 1 Element in 1 Abschnitt")
|
||||
and controller.validation_text.text.contains("Saison 2025/26"),
|
||||
and controller.validation_text.text.contains("Saison 2026/27"),
|
||||
"validation dialog states the scope of the check"
|
||||
)
|
||||
_check(
|
||||
|
|
@ -1323,11 +1323,53 @@ func _run() -> void:
|
|||
)
|
||||
_check(
|
||||
controller.validation_text.text.contains("Basiswert")
|
||||
and controller.validation_text.text.contains("1,70"),
|
||||
and controller.validation_text.text.contains("2,00"),
|
||||
"clean validation shows the base value of a Base spin"
|
||||
)
|
||||
controller.validation_dialog.hide()
|
||||
|
||||
# Adult category validation.
|
||||
controller.new_routine()
|
||||
_check(controller.set_adult_category("gold"), "Gold category can be selected")
|
||||
_check(controller.get_adult_category() == "gold", "the routine stores the category")
|
||||
var selected_category := controller.adult_category_option.selected
|
||||
_check(
|
||||
str(controller.adult_category_option.get_item_metadata(selected_category))
|
||||
== "gold",
|
||||
"the category dropdown reflects the routine"
|
||||
)
|
||||
for code: String in ["1T", "1S", "1Lo", "2T", "2S", "3T"]:
|
||||
controller.add_element_marker(
|
||||
Vector2(0.0, 0.0),
|
||||
PathSegment.ElementType.JUMP,
|
||||
code,
|
||||
0
|
||||
)
|
||||
var category_issues := controller.validate_routine()
|
||||
_check(
|
||||
category_issues.size() >= 3,
|
||||
"the Gold category reports count, jump-type and required-element findings"
|
||||
)
|
||||
controller.open_validation_dialog()
|
||||
_check(
|
||||
controller.validation_text.text.contains("Kategorie: Gold"),
|
||||
"validation dialog names the adult category"
|
||||
)
|
||||
_check(
|
||||
controller.validation_text.text.contains("Sprungelemente: 6"),
|
||||
"validation dialog reports the jump count"
|
||||
)
|
||||
_check(
|
||||
controller.validation_text.text.contains("3T")
|
||||
and controller.validation_text.text.contains("nicht erlaubt"),
|
||||
"validation dialog reports a forbidden Gold jump"
|
||||
)
|
||||
_check(
|
||||
controller.validation_text.text.contains("Choreographic Spin"),
|
||||
"validation dialog reports the missing choreographic spin"
|
||||
)
|
||||
controller.validation_dialog.hide()
|
||||
|
||||
scene.queue_free()
|
||||
await process_frame
|
||||
_finish()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue