Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cap and Capf assertions #1333

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

moeen
Copy link

@moeen moeen commented Jan 28, 2023

Summary

Add Cap and Capf assertions to assert capacity of Array, Slice and Channel types.

Motivation

There is no assertions for capacities in Go in this library. It is specially useful to assert capacity of buffered channels.
Currently you should use assert.Equal and use the cap function.

Related issues

#1332

@moeen moeen closed this Jan 28, 2023
@moeen moeen reopened this Jan 28, 2023
@moeen moeen force-pushed the feature/add-cap branch 3 times, most recently from 18962d9 to 38dcdce Compare January 28, 2023 14:13
@dolmen
Copy link
Collaborator

dolmen commented Jul 6, 2023

That would be just a convenience for a niche use case. I don't think that it is worth extending the API surface at this point.

@dolmen dolmen added enhancement revisit pkg-assert Change related to package testify/assert labels Jul 6, 2023
Copy link
Collaborator

@dolmen dolmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assertion_forward.go is generated code. It must not be edited by hand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement pkg-assert Change related to package testify/assert revisit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants