feat(gui): Implement @symbol regex parser for on-demand definition lookup
This commit is contained in:
27
tests/test_symbol_lookup.py
Normal file
27
tests/test_symbol_lookup.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import pytest
|
||||
from src.app_controller import parse_symbols
|
||||
|
||||
def test_parse_symbols_basic():
|
||||
text = "Check @MyClass and @my_func."
|
||||
symbols = parse_symbols(text)
|
||||
assert symbols == ["MyClass", "my_func"]
|
||||
|
||||
def test_parse_symbols_methods():
|
||||
text = "Calling @MyClass.my_method and @AnotherClass.method_name."
|
||||
symbols = parse_symbols(text)
|
||||
assert symbols == ["MyClass.my_method", "AnotherClass.method_name"]
|
||||
|
||||
def test_parse_symbols_no_symbols():
|
||||
text = "This string has no symbols."
|
||||
symbols = parse_symbols(text)
|
||||
assert symbols == []
|
||||
|
||||
def test_parse_symbols_mixed():
|
||||
text = "Mixed text: @Class1, @func_2, and some text @MyClass.method."
|
||||
symbols = parse_symbols(text)
|
||||
assert symbols == ["Class1", "func_2", "MyClass.method"]
|
||||
|
||||
def test_parse_symbols_edge_cases():
|
||||
text = "@LeadingSymbol and @SymbolAtEnd"
|
||||
symbols = parse_symbols(text)
|
||||
assert symbols == ["LeadingSymbol", "SymbolAtEnd"]
|
||||
Reference in New Issue
Block a user