diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2025-07-05 16:02:33 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2025-07-05 16:02:33 -0700 |
| commit | cab4e2192d5b39e51933ced3dd569de9fc182a04 (patch) | |
| tree | b1c62efb5f661bb70fe882d218f88a7784871055 /docs | |
| parent | b6bca2b7fe943ca4fd8f62a44bcfcc0c9f5a6de1 (diff) | |
Fix string splitting bug and add comprehensive tracker registration tests
- Fix critical bug in tracker address parsing: strings.Split(t, ":") instead of strings.Split(":", t)
- Add dependency injection for TrackerRegistrar to improve testability
- Extract registerWithAllTrackers() helper function to eliminate code duplication
- Add comprehensive test suite covering:
* Unit tests for parseTrackerPassword with edge cases and special characters
* Integration tests for registerWithTrackers with mocking
* Context cancellation and graceful shutdown testing
* Error handling for network failures and malformed addresses
* Edge cases like zero ports, long names, and empty configurations
- Improve password parsing to handle colons in passwords correctly
- Add MockTrackerRegistrar for isolated testing without network dependencies
The string splitting bug would have prevented tracker registration from working
with password-protected trackers. All tests pass and verify the fix works correctly.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions