test(bufdelete): add comprehensive test suite
Description
This PR adds comprehensive test coverage for the bufdelete module, which previously had no tests. The test suite includes 14 test cases that validate the module's API surface, error handling, and core functionality.
Why this PR?
The bufdelete module is a core utility that needs regression protection. While the module is designed for interactive use with window management (making full integration testing challenging in headless environments), this test suite focuses on testable behaviors:
- API Contract: Ensures the module accepts various input formats and maintains backward compatibility
- Error Resilience: Validates graceful handling of edge cases and invalid inputs
- Module Structure: Verifies exported methods and interface consistency
- Filter Logic: Tests the distinction between listed and unlisted buffers
Testing Approach
The test suite uses a pragmatic approach that acknowledges the limitations of unit testing UI-focused functionality. Rather than fighting against Neovim's architecture, it focuses on:
- Option parsing and validation
- Error handling and graceful degradation
- Module interface and exports
- Filter function behavior
This provides valuable regression protection while remaining maintainable and reliable across different test environments.
Test Results Total number of cases: 14 Total number of groups: 1 Fails (0) and Notes (0) All tests pass consistently in the headless test environment.
Related Issue(s)
N/A - This is a proactive contribution to improve test coverage. No existing issue tracks this work.
Screenshots
N/A - This PR adds tests only, with no user-facing changes.