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

attempt to fix/lessen some problems mentioned in issue #9 #10

Merged
merged 4 commits into from
Apr 11, 2023

Conversation

corbym
Copy link
Owner

@corbym corbym commented Apr 5, 2023

Splits up the Length, Empty and Nil matchers.

Unfortunately, for matchers that work on arrays, maps or pointers will still require the compiler to be told the type of the underlying value.
E.g.

// nil pointer, actual is declared as `*string`
then.AssertThat(testing, values.actual, is.NilPtr[string]())
//[]int actual 
then.AssertThat(stubTestingT, test.actual, has.Length[int](test.expected))
// map
then.AssertThat(t, map[string]bool{"hello": true}, has.MapLength[string, bool](1))

.. but vanilla Nil only works on errors and requires no boilerplate types:

then.AssertThat(stubTestingT, someError, is.Nil())

.. would this be more acceptable nitram509?
fixes #9

@corbym corbym marked this pull request as draft April 5, 2023 16:14
@corbym corbym marked this pull request as ready for review April 5, 2023 16:15
@corbym corbym self-assigned this Apr 5, 2023
@coveralls
Copy link

Coverage Status

Coverage: 100.0%. Remained the same when pulling 9e32883 on fix-issue-#9 into 2004755 on master.

@corbym corbym merged commit 70882ef into master Apr 11, 2023
@corbym corbym deleted the fix-issue-#9 branch April 11, 2023 08:23
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.

more boilerplate for has.Length() and is.Nil() after upgrade 1.1.0 release
2 participants