-
-
Notifications
You must be signed in to change notification settings - Fork 211
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
feature extractor for Iterator.next #1816
feature extractor for Iterator.next #1816
Conversation
expect(iterator) | ||
.next() // subject is now of type Int (actually 1) | ||
.toBeGreaterThan(0) // subject is still of type Int (still 1) | ||
.toBeLessThan(2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm... I would remove // subject is still of type Int (still 1)
because toBeGreaterThan does not touch the subject at all (in the contrast to next
) -- I know, you copied this from ListFeatureExtractorSamples. Could you remove it there as well please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll remove the comments from 2 files.
...c/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IteratorExpectationSamples.kt
Outdated
Show resolved
Hide resolved
@@ -30,4 +29,60 @@ class IteratorExpectationSamples { | |||
iterator.next() // returns the next element in iteration | |||
expect(iterator).notToHaveNext() // does not fail as by now iterator has no next element | |||
} | |||
|
|||
@Test | |||
fun nextFeature() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move your sample functions to IteratorFeatureExtractorSamples.kt (this file does not yet exist you need to create it) and adjust the link in the KDoc in the api accordingly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. I'll do.
...c/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IteratorExpectationSamples.kt
Outdated
Show resolved
Hide resolved
...c/commonTest/kotlin/ch/tutteli/atrium/api/fluent/en_GB/samples/IteratorExpectationSamples.kt
Outdated
Show resolved
Hide resolved
* | ||
* @return The newly created [Expect] for the next element. | ||
* | ||
* @sample TODO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just as reminder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx. added a link (file is changed though)
* | ||
* @since 1.3.0 | ||
*/ | ||
fun <E, T : Iterator<E>> Expect<T>.next(assertionCreator: Expect<E>.() -> Unit): Expect<T> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to iteratorFeatureExtractors.kt (the file does not exist yet, create it please)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
created a file an moved this fun there
* | ||
* @since 1.3.0 | ||
*/ | ||
infix fun <E, T : Iterator<E>> Expect<T>.next(@Suppress("UNUSED_PARAMETER") next: next): Expect<E> = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to iteratorFeatureExtractors.kt (the file does not exist yet, create it please).
Please use o
as filler object (see other infix function using o
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replaced next
with o
(file is changed though)
...atrium-logic/src/commonMain/kotlin/ch/tutteli/atrium/logic/impl/DefaultIteratorAssertions.kt
Outdated
Show resolved
Hide resolved
...-specs/src/commonMain/kotlin/ch/tutteli/atrium/specs/integration/IteratorExpectationsSpec.kt
Show resolved
Hide resolved
@hubtanaka Atrium uses bc-validator for a try. As you change the api (new methods) we need to dump the api. Please execute the following (I guess the build will then pass):
Thanks |
Co-authored-by: Robert Stoll <rstoll@tutteli.ch>
Co-authored-by: Robert Stoll <rstoll@tutteli.ch>
Co-authored-by: Robert Stoll <rstoll@tutteli.ch>
…com/hubtanaka/atrium into feature/extractor-for-Iterator.next
Co-authored-by: Robert Stoll <rstoll@tutteli.ch>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1816 +/- ##
============================================
+ Coverage 92.81% 92.83% +0.01%
Complexity 116 116
============================================
Files 442 444 +2
Lines 4941 4953 +12
Branches 234 234
============================================
+ Hits 4586 4598 +12
Misses 308 308
Partials 47 47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@robstoll thanks for your review. The one thing I failed is I run
So I'll find out something wrong tomorrow (just because I'm sleepy a little bit today). Please let me know if there is something what I should do obviously. |
Can you paste the output in a gist or the like. The excerpt you show is just a warning the build error as such is most likely further above. As a quick fix, you can also copy the changes in: to apis/fluent/atrium-api-fluent/api/using-kotlin-1.9-or-newer/atrium-api-fluent.api and of course, same same for infix and logic |
sorry, this is full of the output of my Terminal. PS C:\Users\tutus\work\github\atrium> ./gradlew.bat apiDump KOTLIN_VERSION=1.9
FAILURE: Build failed with an exception.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 1s
FAILURE: Build failed with an exception.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.9/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 1s |
I see, try the following:
In the end KOTLIN_VERSION needs to be available as environment variable for gradle |
I am afraid my Windows knowledge is a bit outdated, I thought it supports an export command as well by now. Good that it worked via IntelliJ 🙂👍 |
Issue #1765
logic
api-fluent
api-infix
I confirm that I have read the Contributor Agreements v1.0, agree to be bound on them and confirm that my contribution is compliant.