Skip to content

fix: re-enable LockmanResult tests with updated API compatibility - #232

Merged
takeshishimada merged 1 commit into
mainfrom
fix/re-enable-lockman-result-tests
Sep 20, 2025
Merged

fix: re-enable LockmanResult tests with updated API compatibility#232
takeshishimada merged 1 commit into
mainfrom
fix/re-enable-lockman-result-tests

Conversation

@takeshishimada

Copy link
Copy Markdown
Owner

Summary

Re-enabled LockmanResultTests.swift by updating all test methods to work with the new LockmanResult API that includes unlockToken parameters.

Problem

The LockmanResultTests.swift file was disabled (.disabled extension) because it was incompatible with the new LockmanResult API introduced in the major refactoring. The new API requires unlockToken parameters for success cases.

Solution

  • API Compatibility: Updated all test methods to use new LockmanResult API with unlockToken parameters
  • Test Infrastructure: Used TestSingleExecutionStrategy from TestSupport for proper unlock token creation
  • Parameter Fixes: Fixed TestLockmanInfo constructor calls with correct parameter order
  • Access Control: Removed attempts to access fileprivate properties, focusing on public API testing

Changes

LockmanResult API Updates

// Old API (disabled tests expected)
.success
.successWithPrecedingCancellation(error: error)

// New API (now implemented)  
.success(unlockToken: token)
.successWithPrecedingCancellation(unlockToken: token, error: error)

Test Coverage Maintained

  • 13 comprehensive test methods all updated and passing
  • Phase 1: Basic enum case testing with unlockToken
  • Phase 2: Sendable conformance and concurrent access testing
  • Phase 3: Error protocol integration testing
  • Phase 4: unlockToken functionality and type safety testing

Test Results

Test Suite 'LockmanResultTests' passed at 2025-09-10 01:26:35.836.
Executed 13 tests, with 0 failures (0.036 seconds)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Test improvement (improves test coverage or reliability)

🤖 Generated with Claude Code

## Summary
- Re-enabled LockmanResultTests.swift by updating for new LockmanResult API
- Fixed all test methods to work with unlockToken parameters
- Removed .disabled extension from test file

## Changes Made
### API Compatibility Updates
- Updated all LockmanResult case usage to include unlockToken parameters:
  - .success(unlockToken: token)
  - .successWithPrecedingCancellation(unlockToken: token, error: error)
  - .cancel(error) remains unchanged
- Replaced mock strategy with TestSingleExecutionStrategy from TestSupport
- Fixed TestLockmanInfo constructor calls with proper parameter order

### Test Coverage Maintained
- All 13 comprehensive test methods updated and working
- Phase 1: Basic enum case testing with unlockToken
- Phase 2: Sendable conformance and concurrent access testing
- Phase 3: Error protocol integration testing
- Phase 4: unlockToken functionality and type safety testing

### Technical Fixes
- Removed fileprivate property access (LockmanUnlock.info)
- Fixed strategy ID references to use TestSingleExecutionStrategy
- Updated all TestLockmanInfo instantiations with correct parameters
- Ensured all pattern matching works with new API structure

## Test Results
- ✅ All 13 tests pass (Executed 13 tests, with 0 failures)
- ✅ Complete API compatibility with unlockToken integration
- ✅ Comprehensive coverage of LockmanResult enum functionality

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@takeshishimada takeshishimada added bug Something isn't working test Adding or updating tests labels Sep 9, 2025
@takeshishimada takeshishimada self-assigned this Sep 9, 2025
@takeshishimada takeshishimada added bug Something isn't working test Adding or updating tests labels Sep 9, 2025
@takeshishimada
takeshishimada merged commit 7771953 into main Sep 20, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working test Adding or updating tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant