Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 4 additions & 10 deletions tests/test_languages/test_language_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,25 +440,19 @@ def test_async_functions_discovery(self, python_support, js_support):
assert js_sync.is_async is False, "JavaScript sync function should have is_async=False"

def test_nested_functions_discovery(self, python_support, js_support):
"""Python skips nested functions; JavaScript discovers them with parent info."""
"""Both Python and JavaScript skip nested functions — only outer is discovered."""
py_file = write_temp_file(NESTED_FUNCTIONS.python, ".py")
js_file = write_temp_file(NESTED_FUNCTIONS.javascript, ".js")

py_funcs = python_support.discover_functions(py_file.read_text(encoding="utf-8"), py_file)
js_funcs = js_support.discover_functions(js_file.read_text(encoding="utf-8"), js_file)

# Python skips nested functions — only outer is discovered
# Both skip nested functions — only outer is discovered
assert len(py_funcs) == 1, f"Python found {len(py_funcs)}, expected 1"
assert py_funcs[0].function_name == "outer"

# JavaScript discovers both
assert len(js_funcs) == 2, f"JavaScript found {len(js_funcs)}, expected 2"
js_names = {f.function_name for f in js_funcs}
assert js_names == {"outer", "inner"}, f"JavaScript found {js_names}"

js_inner = next(f for f in js_funcs if f.function_name == "inner")
assert len(js_inner.parents) >= 1, "JavaScript inner should have parent info"
assert js_inner.parents[0].name == "outer", "JavaScript inner's parent should be outer"
assert len(js_funcs) == 1, f"JavaScript found {len(js_funcs)}, expected 1"
assert js_funcs[0].function_name == "outer"

def test_static_methods_discovery(self, python_support, js_support):
"""Both should discover static methods."""
Expand Down
Loading