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/test with github.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.go files
go.mod and go.sum
Acceptance Criteria
Additional Notes
This change will improve the project's maintainability and align it with Go testing best practices.
Convert test framework from broothie/test to testify/assert
Summary
Replace the current
github.com/broothie/testtesting framework with the more widely adoptedgithub.com/stretchr/testify/assertpackage.Background
The current test framework appears to have compatibility issues and non-standard API signatures (e.g.,
test.Trueexpecting only 2 arguments instead of optional message strings). Using testify/assert would provide:Current Issues
Implementation Plan
Update dependencies: Replace
github.com/broothie/testwithgithub.com/stretchr/testify/assertUpdate 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
*_test.gofilesgo.modandgo.sumAcceptance Criteria
Additional Notes
This change will improve the project's maintainability and align it with Go testing best practices.