-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_case_sensitivity.py
More file actions
72 lines (58 loc) · 2.2 KB
/
test_case_sensitivity.py
File metadata and controls
72 lines (58 loc) · 2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python3
"""
Test to verify case sensitivity and exact command names.
"""
import sys
from pathlib import Path
# Add current directory to path
script_dir = Path(__file__).parent.absolute()
sys.path.insert(0, str(script_dir))
from completions import get_contextual_completions
from lsprotocol.types import CompletionItemKind
def test_case_variations():
# Test document content
test_code = """Proceso Test
Definir x Como Entero
"""
# Get completions at line 2 (inside process)
completions = get_contextual_completions(test_code, 2, 4)
# Check for case variations of the problematic commands
target_variations = [
# Original case
"FinPara", "FinSegun", "FinSi", "FinMientras", "Repetir",
"BorrarPantalla", "EsperarTecla",
# All lowercase
"finpara", "finsegun", "finsi", "finmientras", "repetir",
"borrarpantalla", "esperartecla",
# All uppercase (as mentioned by user)
"FINPARA", "FINSEGUN", "FINSI", "FINMIENTRAS", "REPETIR",
"BORRARPANTALLA", "ESPERARTECLA"
]
print("Checking for all case variations:")
print("=" * 50)
found_any = {}
for completion in completions:
label_lower = completion.label.lower()
for target in target_variations:
if completion.label == target:
if target not in found_any:
found_any[target] = []
found_any[target].append(completion)
for target in target_variations:
if target in found_any:
for completion in found_any[target]:
print(f"{target:15} -> {completion.kind}")
else:
print(f"{target:15} -> NOT FOUND")
print("\nAll exact matches found:")
print("=" * 50)
original_targets = [
"FinPara", "FinSegun", "FinSi", "FinMientras", "Repetir",
"BorrarPantalla", "EsperarTecla"
]
for completion in completions:
if completion.label in original_targets:
result = "✅ KEYWORD" if completion.kind == CompletionItemKind.Keyword else "⚠️ FUNCTION"
print(f"{completion.label:15} -> {result}")
if __name__ == "__main__":
test_case_variations()