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

Added inline version for intanceOf alias #1838

Merged
merged 1 commit into from Nov 9, 2020
Merged

Conversation

dmstocking
Copy link
Contributor

Added a version of instanceOf that is inlined with a reified generic
type. This was done to remove the need for ::class from the caller.
This type of function is already implemented for beInstanceOf and
beOfType. This commit just also adds it to instanceOf.

Also updated the tests to test every matcher, even aliases. I don't
suspect anyone would accidentally change the implementation of the
aliased functions, but you never know.

Fixes #1836

Added a version of `instanceOf` that is inlined with a reified generic
type. This was done to remove the need for `::class` from the caller.
This type of function is already implemented for `beInstanceOf` and
`beOfType`. This commit just also adds it to `instanceOf`.

Also updated the tests to test every matcher, even aliases. I don't
suspect anyone would accidentally change the implementation of the
aliased functions, but you never know.
@sksamuel
Copy link
Member

sksamuel commented Nov 9, 2020

Thanks. There's always .shouldBeInstanceOf<T> too but this makes the infix version nicer to use.

@sksamuel sksamuel merged commit 9bd526f into kotest:master Nov 9, 2020
@sksamuel sksamuel mentioned this pull request Dec 1, 2020
43 tasks
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.

Add inline version of instanceOf to simplify usage
2 participants