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

unsafeInstanceOf Quality, closes #155 #156

Merged
merged 1 commit into from
Dec 28, 2023
Merged

unsafeInstanceOf Quality, closes #155 #156

merged 1 commit into from
Dec 28, 2023

Conversation

dmfs
Copy link
Collaborator

@dmfs dmfs commented Dec 28, 2023

This provides a Quality similar to istanceOf but also taking Qualitys of subclasses of the given class. This is unsafe because there is no guarantee that the testee is actually of that subtype, but it may be required if the testee is a generic class.

It solves issues like described in
hamcrest/JavaHamcrest#388

@@ -43,7 +43,7 @@


@StaticFactories(value = "Core", packageName = "org.saynotobugs.confidence.quality")
public final class Iterates<T> implements Quality<Iterable<T>>
public final class Iterates<T> implements Quality<Iterable<? extends T>>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ups, this should be reverted

This provides a Quality similar to `istanceOf` but also taking
`Quality`s of subclasses of the given class. This is unsafe because
there is no guarantee that the testee is actually of that subtype, but
it may be required if the testee is a generic class.

It solves issues like described in
hamcrest/JavaHamcrest#388
@codecov-commenter
Copy link

codecov-commenter commented Dec 28, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7853662) 97.71% compared to head (f6da1cc) 97.71%.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff            @@
##               main     #156   +/-   ##
=========================================
  Coverage     97.71%   97.71%           
- Complexity      820      821    +1     
=========================================
  Files           212      213    +1     
  Lines          1791     1793    +2     
  Branches         56       56           
=========================================
+ Hits           1750     1752    +2     
  Misses           31       31           
  Partials         10       10           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dmfs dmfs merged commit 15c8981 into main Dec 28, 2023
3 checks passed
@dmfs dmfs deleted the 155-unsafeInstanceOf branch December 28, 2023 22:12
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.

3 participants