Repository navigation
Conversation
ab4b7ac to
a5847c9
Compare
7cc531e to
fab9f82
Compare
|
Perhaps it makes sense to defer a review until the CI runs without errors -- either because the underlying cause of the CI failures have been fixed, or the ULSP tests are explicitly disabled for the configurations that currently fail. |
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
58306ef to
60be717
Compare
Add a complete test suite for the Unicon Language Server Protocol (ULSP) implementation with four main test categories: 1. JSON-RPC Tests (jsonrpc_test.icn) - Tests JSON-RPC protocol with calculator server - Validates concurrent request handling - Tests basic arithmetic operations 2. LSP Message Tests (lsp_message_test.icn) - Tests JSON-RPC message parsing and validation - Tests all LSP request/response message types - Tests notification handling - Tests error handling and malformed message rejection 3. LSP Feature Tests (lsp_feature_test.icn) - Tests LSP features with realistic Unicon code - Tests completion, hover, definition, symbols, formatting, folding - Tests signature help functionality - Uses LSPDB for symbol information 4. LSP Protocol Tests (lsp_protocol_test.icn) - Integration tests with actual server-client communication - Tests server initialization and capability negotiation - Tests document synchronization (didOpen, didChange, didSave) - Tests end-to-end LSP feature workflows Unified Test Runner (lsp_run_tests.icn): - Executes all four test suites sequentially - Aggregates test counts from all suites - Provides comprehensive test reporting - Supports individual test suite execution Test Framework Features: - Expected result capture mode with JSON output - Deep comparison for expected vs actual results - JSON-formatted error reporting - Consistent test structure across all test files - Proper Unicon success/failure semantics Makefile Integration: - Individual test targets for each test suite - Unified test runner target - Clean targets for test artifacts All test files follow consistent structure: - Test class with run_all_tests() method - Global counters for test tracking - Standalone execution support via $ifdef STANDALONE
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
Signed-off-by: Jafar Al-Gharaibeh <[email protected]>
Greptile SummaryThis PR introduces a comprehensive ULSP (Unicon Language Server Protocol) test framework consisting of a reusable Key issues found:
Confidence Score: 2/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Main as lsp_test_suite
participant Suite as UniconTestSuite
participant JT as JSONRPCTest
participant MT as LSPMessageTest
participant FT as LSPFeatureTest
participant PT as LSPProtocolTest
participant Srv as ULSP Server
participant DB as LSPDB
Main->>Suite: add_test(JSONRPCTest)
Main->>Suite: add_test(LSPMessageTest)
Main->>Suite: add_test(LSPFeatureTest)
Main->>Suite: add_test(LSPProtocolTest)
Main->>Suite: run_all_tests()
Suite->>JT: _setup_tests() → register_tests()
Suite->>MT: _setup_tests() → register_tests()
Suite->>FT: _setup_tests() → register_tests()
Suite->>PT: _setup_tests() → register_tests()
Suite->>JT: _execute() → setup / run / teardown
JT-->>Suite: pass/fail counts
Suite->>MT: _execute() → setup / run / teardown
MT-->>Suite: pass/fail counts
Suite->>FT: _execute()
FT->>DB: LSPDB().build()
DB-->>FT: database ready
FT->>FT: run test_completion / test_hover / ...
FT-->>Suite: pass/fail counts
Suite->>PT: _execute()
PT->>Srv: system(["ulsp","--socket",port],"nowait")
note over PT,Srv: delay(5000ms)
PT->>Srv: connect()
PT->>Srv: initialize request
Srv-->>PT: capabilities response
PT->>Srv: didOpen / didChange / didSave notifications
PT->>Srv: completion / hover / definition / symbols requests
Srv-->>PT: responses
PT->>Srv: shutdown + exit
PT-->>Suite: pass/fail counts
Suite-->>Main: aggregated results
Main->>Main: print_summary() + exit(0/1)
|
| # unicon directory | ||
|
|
||
| # remove the trailing slash it could be / or \ | ||
| c := path[-1:0] |
There was a problem hiding this comment.
Semantic change: ulibprefix() now fails instead of returning &null
The original code unconditionally returned prefix (which could be &null, succeeding with a null value). The new code falls off the end of the procedure when prefix is null — in Unicon this means the procedure fails.
Any caller that relied on getting &null back (e.g., ulibpaths() which does prefix := ulibprefix() and then builds libpath := prefix || "ipl/lib" || ...) will now also silently fail when no prefix is found, potentially causing library path resolution to break silently on systems where the prefix cannot be detected.
If the intent is to fail when no prefix is found, callers such as ulibpaths() should guard against this explicitly with if prefix := ulibprefix() then .... Please confirm this behavior change is intentional and update callers accordingly.
Add a complete test suite for the Unicon Language Server Protocol (ULSP)
implementation with four main test categories:
JSON-RPC Tests (jsonrpc_test.icn)
LSP Message Tests (lsp_message_test.icn)
LSP Feature Tests (lsp_feature_test.icn)
LSP Protocol Tests (lsp_protocol_test.icn)
Unified Test Runner (lsp_run_tests.icn):
Test Framework Features:
Makefile Integration:
All test files follow consistent structure: