-
Notifications
You must be signed in to change notification settings - Fork 3
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
Truth support #7
Comments
I have some experience with writing custom Truth code, so I could definitely work on this. My question however is, what would the API surface of this look like? As Jorge mentions, this should be a separate artifact on top of the main one. I'm thinking about something along the lines of this: // Prepare
val compilation: Compilation = kotlinc().withProcessors(...).compile()
// Check for success
assertThat(compilation) // from the "kompile-testing-truth" library
.succeeded()
.generatedFile(...)
.source() // at this point, it's a normal Truth StringSubject
.isEqualTo("...")
// Check for failure
assertThat(compilation) // from the "kompile-testing-truth" library
.failed()
.errors() // at this point, it's a normal Truth ListSubject
.contains("...") Thing is, would this really be that big of a benefit over the current API? It's just about equally as fluent. |
Seems compile-testing provides some Truth-coupled API to give users fluent ways to assert and show error/warning message(and also perhaps both are maintained by the same team)? Right now we only have minimal set of assert ways that were necessary for PD test suite. But yea..it'd be almost the same as current one except Refs:https://javadoc.io/doc/com.google.testing.compile/compile-testing/0.15 |
@JorgeCastilloPrz, allow me to weave you into this convo since the request came from your end. What would be requirements for a Truth integration with regards to the block above from your perspective? |
https://mobile.twitter.com/JorgeCastilloPr/status/1081473043749367808
The text was updated successfully, but these errors were encountered: