Skip to content

Convert test framework from broothie/test to testify/assert #14

@broothie

Description

@broothie

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

  1. Update dependencies: Replace github.com/broothie/test with github.com/stretchr/testify/assert

  2. Update imports: Change all test file imports from "github.com/broothie/test" to "github.com/stretchr/testify/assert"

  3. 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)
  4. Update go.mod: Remove broothie/test dependency and add testify

  5. Test compatibility: Ensure all tests pass with new framework

Files to Update

  • All *_test.go files
  • go.mod and go.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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions