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

New Rule: cap assertion #138

Merged
merged 1 commit into from
Mar 14, 2024
Merged

New Rule: cap assertion #138

merged 1 commit into from
Mar 14, 2024

Conversation

nunnatsa
Copy link
Owner

Description

Trigger warnings for directly assert the builtin cap function.

For example:

Expect(cap(slice)).To(Equal(10)) ==> Expect(slice).To(HaveCap(10))
Expect(cap(slice) == 10).To(BeTrue()) ==> Expect(slice).To(HaveCap(10))

Type of change

  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • Added test case and related test data
  • Update the functional test

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I ran golangci-lint

Trigger warnings for directly assert the builtin `cap` function.

For example:
```go
Expect(cap(slice)).To(Equal(10)) ==> Expect(slice).To(HaveCap(10))
Expect(cap(slice) == 10).To(BeTrue()) ==> Expect(slice).To(HaveCap(10))
```
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 8280717642

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 66.89%

Totals Coverage Status
Change from base Build 8227609747: 0.0%
Covered Lines: 200
Relevant Lines: 299

💛 - Coveralls

@nunnatsa nunnatsa merged commit 4ade2b4 into main Mar 14, 2024
1 check passed
@nunnatsa nunnatsa deleted the cap-equal branch March 14, 2024 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants