feat: type_fields in diff and tracker, joined with emulator property reads
The tracker lists each scope's original properties (constructor chain, or class fields up the chain for Piklib 6.1 and singletons such as SCENE) and where the emulator reads them: a CNVParser.createVariable case arm, an attribute read in the type's class or Variable.java, or other code. The switch-arm parser is shared with the @ statements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
9d5a600d6b
commit
aee8f17417
@@ -139,3 +139,15 @@ def test_type_events_diff_by_script_type():
|
||||
block = compute_diff(old, new)["type_events"]
|
||||
assert [e["name"] for e in block["added"]] == ["ONFRAMEUPDATED"] and not block["removed"]
|
||||
assert filter_by_owner(compute_diff(old, new), "MOVIE")["type_events"]["added"]
|
||||
|
||||
|
||||
|
||||
def test_type_fields_diff_tracks_value_types():
|
||||
from ams.diff import compute_diff
|
||||
from ams.snapshot import Snapshot
|
||||
old = Snapshot({"type_fields": [{"type": "VECTOR", "name": "VALUE", "value_types": ["list"], "order": 0}]})
|
||||
new = Snapshot({"type_fields": [{"type": "VECTOR", "name": "VALUE", "value_types": ["list", "string"], "order": 0},
|
||||
{"type": "VECTOR", "name": "SIZE", "value_types": ["int"], "order": 1}]})
|
||||
block = compute_diff(old, new)["type_fields"]
|
||||
assert [f["name"] for f in block["added"]] == ["SIZE"]
|
||||
assert block["changed"][0]["changes"]["value_types"] == [["list"], ["list", "string"]]
|
||||
|
||||
Reference in New Issue
Block a user