Skip to content

Conversation

@Jafaral
Copy link
Member

@Jafaral Jafaral commented Nov 24, 2025

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

@Jafaral Jafaral force-pushed the ulsp-testing branch 3 times, most recently from ab4b7ac to a5847c9 Compare November 24, 2025 17:16
@Jafaral Jafaral requested review from Don-Ward and cjeffery November 24, 2025 17:45
@Don-Ward
Copy link
Collaborator

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.

@Jafaral Jafaral marked this pull request as draft December 1, 2025 06:30
@Jafaral Jafaral changed the title lib,ulsp: jsonrpc and ulsp fixes with a ULSP test suite A new test framwork with a ULSP test suite Dec 1, 2025
@Jafaral Jafaral force-pushed the ulsp-testing branch 2 times, most recently from 58306ef to 60be717 Compare December 7, 2025 18:34
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants