checkpoint: massive refactor

This commit is contained in:
2026-02-28 09:06:45 -05:00
parent f2512c30e9
commit d36632c21a
149 changed files with 16255 additions and 17722 deletions

View File

@@ -2,8 +2,8 @@ import pytest
from file_cache import ASTParser
def test_ast_parser_get_curated_view():
parser = ASTParser("python")
code = '''
parser = ASTParser("python")
code = '''
@core_logic
def core_func():
"""Core logic doc."""
@@ -25,20 +25,16 @@ class MyClass:
def core_method(self):
print("method preserved")
'''
curated = parser.get_curated_view(code)
# Check that core_func is preserved
assert 'print("this should be preserved")' in curated
assert 'return True' in curated
# Check that hot_func is preserved
assert '# [HOT]' in curated
assert 'print("this should also be preserved")' in curated
# Check that normal_func is stripped but docstring is preserved
assert '"""Normal doc."""' in curated
assert 'print("this should be stripped")' not in curated
assert '...' in curated
# Check that core_method is preserved
assert 'print("method preserved")' in curated
curated = parser.get_curated_view(code)
# Check that core_func is preserved
assert 'print("this should be preserved")' in curated
assert 'return True' in curated
# Check that hot_func is preserved
assert '# [HOT]' in curated
assert 'print("this should also be preserved")' in curated
# Check that normal_func is stripped but docstring is preserved
assert '"""Normal doc."""' in curated
assert 'print("this should be stripped")' not in curated
assert '...' in curated
# Check that core_method is preserved
assert 'print("method preserved")' in curated