-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Convert test framework from broothie/test to testify/assert
Summary
Replace the current github.com/broothie/test testing framework with the more widely adopted github.com/stretchr/testify/assert package.
Background
The current test framework appears to have compatibility issues and non-standard API signatures (e.g., test.True expecting only 2 arguments instead of optional message strings). Using testify/assert would provide:
- Better community support and documentation
- More stable API
- Better error messages and diagnostics
- Wider ecosystem compatibility
- Standard testing patterns familiar to most Go developers
Current Issues
- Test compilation failures due to API mismatches
- Limited functionality compared to testify
- Maintenance overhead for custom test framework
Implementation Plan
-
Update dependencies: Replace
github.com/broothie/testwithgithub.com/stretchr/testify/assert -
Update imports: Change all test file imports from
"github.com/broothie/test"to"github.com/stretchr/testify/assert" -
Convert test methods:
test.NoError(t, err)→assert.NoError(t, err)test.Equal(t, expected, actual)→assert.Equal(t, expected, actual)test.True(t, condition)→assert.True(t, condition)test.False(t, condition)→assert.False(t, condition)test.NotNil(t, value)→assert.NotNil(t, value)
-
Update go.mod: Remove broothie/test dependency and add testify
-
Test compatibility: Ensure all tests pass with new framework
Files to Update
- All
*_test.gofiles go.modandgo.sum
Acceptance Criteria
- All test files use testify/assert instead of broothie/test
- All tests compile and pass
- Dependencies updated in go.mod
- No references to broothie/test remain in codebase
Additional Notes
This change will improve the project's maintainability and align it with Go testing best practices.