T6 探针基建收口段: 三族样板收单点(probe_ui_util树寻址contains/begins_with参数化+isolate_save七份隔离样板/battle_driver五份战斗驱动)+level_autoplay双战斗循环合并_decide_act+test_kit收13套件_check样板(断言数逐套件零丢失对照表在报告)+BAD_DIR夹具共享+smoke_all五件(:953公有面clamped_pool/_battle_st七袋/check_silent并入quiet参/_pct转发删/load改preload);探针小件=main句柄Node类型注/魔法等待常量化/画布常数同源锚注/死参verbose删;红线守住=ui_input case④b与click循环体零触碰/拍板点三件未退役
This commit is contained in:
1 parent
0691a188fd
commit
315e46038c
32 files changed
+587
-764
No files matched your search
@@ -12,35 +12,19 @@ const ConfigDBScript := preload("res://core/config_db.gd")
|
||||
const RngServiceScript := preload("res://core/rng_service.gd")
|
||||
const StatusContainerScript := preload("res://core/status_container.gd")
|
||||
const DamageControllerScript := preload("res://core/damage_controller.gd")
|
||||
|
||||
var _failures := 0
|
||||
var _checks := 0
|
||||
const Kit := preload("res://tests/unit/test_kit.gd") # T6 收口:_check/汇总退出样板单点
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
var db = ConfigDBScript.new()
|
||||
var load_ok: bool = db.load_tables("res://data/tables", true)
|
||||
_check("前置:表加载零 error", load_ok and db.diagnostics_count("error") == 0)
|
||||
Kit.check("前置:表加载零 error", load_ok and db.diagnostics_count("error") == 0)
|
||||
if load_ok:
|
||||
_test_damage_controller_vocabularies()
|
||||
_test_rng_tag_closure(db)
|
||||
_test_ticket_nine_columns()
|
||||
_test_status_boolean_acceptance(db)
|
||||
if _failures > 0:
|
||||
push_error("[system_contracts_test] %d/%d 项失败" % [_failures, _checks])
|
||||
quit(1)
|
||||
return
|
||||
print("[system_contracts_test] all green (%d checks)" % _checks)
|
||||
quit(0)
|
||||
|
||||
|
||||
func _check(desc: String, ok: bool) -> void:
|
||||
_checks += 1
|
||||
if ok:
|
||||
print(" [PASS] " + desc)
|
||||
else:
|
||||
_failures += 1
|
||||
push_error(" [FAIL] " + desc)
|
||||
quit(Kit.finish("system_contracts_test"))
|
||||
|
||||
|
||||
# ---- B1 兑付配方词表:五配方/三目标规则/双结账政策——常量非空且互异(封闭枚举负空间) ----
|
||||
@@ -55,11 +39,11 @@ func _test_damage_controller_vocabularies() -> void:
|
||||
for k in kinds:
|
||||
if String(k).is_empty():
|
||||
nonempty = false
|
||||
_check("五配方常量非空(开单面唯一分派键)", nonempty)
|
||||
Kit.check("五配方常量非空(开单面唯一分派键)", nonempty)
|
||||
var unique_kinds: Dictionary = {}
|
||||
for k in kinds:
|
||||
unique_kinds[String(k)] = true
|
||||
_check("五配方常量互异(词表封闭无别名)", unique_kinds.size() == kinds.size())
|
||||
Kit.check("五配方常量互异(词表封闭无别名)", unique_kinds.size() == kinds.size())
|
||||
var targets: Array = [
|
||||
DamageControllerScript.TARGET_FRONT_ALIVE, DamageControllerScript.TARGET_HERO,
|
||||
DamageControllerScript.TARGET_ALL_ALIVE,
|
||||
@@ -67,8 +51,8 @@ func _test_damage_controller_vocabularies() -> void:
|
||||
var unique_targets: Dictionary = {}
|
||||
for t in targets:
|
||||
unique_targets[String(t)] = true
|
||||
_check("三目标规则常量互异(结账时刻现场解析词表)", unique_targets.size() == targets.size())
|
||||
_check("双结账政策常量互异(A 即结 / B 攒批回切位)",
|
||||
Kit.check("三目标规则常量互异(结账时刻现场解析词表)", unique_targets.size() == targets.size())
|
||||
Kit.check("双结账政策常量互异(A 即结 / B 攒批回切位)",
|
||||
String(DamageControllerScript.POLICY_IMMEDIATE) != String(DamageControllerScript.POLICY_SEGMENT))
|
||||
|
||||
|
||||
@@ -76,9 +60,9 @@ func _test_damage_controller_vocabularies() -> void:
|
||||
|
||||
func _test_rng_tag_closure(db) -> void:
|
||||
var stream_label: String = String(db.settlement.armor_roll_stream)
|
||||
_check("settlement.armor_roll_stream ∈ RngService 封闭标签词表(EC12)",
|
||||
Kit.check("settlement.armor_roll_stream ∈ RngService 封闭标签词表(EC12)",
|
||||
RngServiceScript.PURPOSE_TAGS.has(stream_label))
|
||||
_check("RngService 用途标签词表非空且互异(封闭语义由流改标签)",
|
||||
Kit.check("RngService 用途标签词表非空且互异(封闭语义由流改标签)",
|
||||
RngServiceScript.PURPOSE_TAGS.size() > 0)
|
||||
|
||||
|
||||
@@ -95,9 +79,9 @@ func _test_ticket_nine_columns() -> void:
|
||||
for c in columns:
|
||||
if not t.has(c):
|
||||
all_present = false
|
||||
_check("单据九栏 + 可选两栏缺省齐备(开单面只写差异栏前提)", all_present)
|
||||
_check("缺省无类型轴(attack_type 空 = 恒不查克制矩阵)", String(t.attack_type) == "")
|
||||
_check("缺省无前置依赖(requires = -1)", int(t.requires) == -1)
|
||||
Kit.check("单据九栏 + 可选两栏缺省齐备(开单面只写差异栏前提)", all_present)
|
||||
Kit.check("缺省无类型轴(attack_type 空 = 恒不查克制矩阵)", String(t.attack_type) == "")
|
||||
Kit.check("缺省无前置依赖(requires = -1)", int(t.requires) == -1)
|
||||
|
||||
|
||||
func _bare_controller():
|
||||
@@ -129,18 +113,18 @@ func _test_status_boolean_acceptance(db) -> void:
|
||||
var any_row: Dictionary = {}
|
||||
if db.status_effects.rows.size() > 0:
|
||||
any_row = db.status_effects.rows[0]
|
||||
_check("前置:状态表非空", not any_row.is_empty())
|
||||
Kit.check("前置:状态表非空", not any_row.is_empty())
|
||||
if any_row.is_empty():
|
||||
return
|
||||
var probe_id: String = String(any_row.effect_id)
|
||||
var src := {"source_class": "safe_cell", "origin_cell": Vector2i(-1, -1), "round_index": 0}
|
||||
_check("域闭授予拒绝(EC1——战斗域外 apply_effect = false)", effects.apply_effect(probe_id, src) == false)
|
||||
_check("未知 effect_id 拒绝(EC2)", effects.apply_effect("no_such_effect_id__", src) == false)
|
||||
Kit.check("域闭授予拒绝(EC1——战斗域外 apply_effect = false)", effects.apply_effect(probe_id, src) == false)
|
||||
Kit.check("未知 effect_id 拒绝(EC2)", effects.apply_effect("no_such_effect_id__", src) == false)
|
||||
effects.notify_battle_start()
|
||||
_check("开域后受理已知 id(布尔受理口径 true 通道)", effects.apply_effect(probe_id, src) == true)
|
||||
Kit.check("开域后受理已知 id(布尔受理口径 true 通道)", effects.apply_effect(probe_id, src) == true)
|
||||
var active: Array = effects.query_active(String(any_row.target_side))
|
||||
var projected := false
|
||||
for a in active:
|
||||
if String(a.effect_id) == probe_id:
|
||||
projected = int(a.effective_value) == int(a.layers) * int(a.snap_magnitude)
|
||||
_check("受理后投影 effective_value = 层数×授予时快照(抗热重载 EC9 面)", projected)
|
||||
Kit.check("受理后投影 effective_value = 层数×授予时快照(抗热重载 EC9 面)", projected)
|
||||
Reference in new issue
Block a user