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

Truth support #7

Open
hotchemi opened this issue Jan 5, 2019 · 3 comments
Open

Truth support #7

hotchemi opened this issue Jan 5, 2019 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@hotchemi
Copy link
Member

hotchemi commented Jan 5, 2019

https://mobile.twitter.com/JorgeCastilloPr/status/1081473043749367808

@hotchemi hotchemi added the help wanted Extra attention is needed label Jan 5, 2019
@mannodermaus
Copy link
Contributor

mannodermaus commented Jan 5, 2019

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.

@hotchemi
Copy link
Member Author

hotchemi commented Jan 5, 2019

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 assertThat in my opinion😅And I'm not sure the position of Truth among Kotlin community actually..already dominant?😇

Refs:

https://javadoc.io/doc/com.google.testing.compile/compile-testing/0.15
http://google.github.io/truth/comparison

@mannodermaus
Copy link
Contributor

@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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants