Add ComparableSubject#isAtLeast to Kruth#519
Add ComparableSubject#isAtLeast to Kruth#519veyndan wants to merge 2 commits intoandroidx:androidx-mainfrom
ComparableSubject#isAtLeast to Kruth#519Conversation
a1558b0 to
222d549
Compare
222d549 to
59a572d
Compare
| * @throws NullPointerException if [actual] or [other] is `null`. | ||
| */ | ||
| fun isAtLeast(other: T?) { | ||
| if (actual == null || other == null) { |
There was a problem hiding this comment.
Let's use the existing requireNonNull function?
There was a problem hiding this comment.
Can do! The implementation was mostly a copy-paste of the isLessThan function above. It could perhaps be simplified there too (in a separate PR).
There was a problem hiding this comment.
@arkivanov Replacing this line with requireNotNull would mean an IllegalArgumentException would be thrown instead of a NullPointerException. This diverges from Truth, as their isAtLeast function also throws a NullPointerException. Was the original suggestion to also change the throwable type?
There was a problem hiding this comment.
I meant our internal function, see
There was a problem hiding this comment.
Oops, my bad! You had linked it in the first message — I completely overlooked it.
Changed in 20d36a6.
To migrate the tests in
paging-commonfrom Truth to Kruth,isAtLeastneeds to be added to Kruth:androidx/paging/paging-common/src/test/kotlin/androidx/paging/FlowExtTest.kt
Lines 289 to 290 in 72a6b2e
Test: ./gradlew test connectedCheck
Bug: 270612487