https://kotlinlang.org logo
#squarelibraries
Title
# squarelibraries
m

Mohamed Ibrahim

06/30/2022, 7:11 PM
what is the right way to write unit tests for the code generated using
KotlinPeot
, I mean is it a try and error after compiling the project? excuse my ignorance this is the first time I’m using it.
👌 1
m

Mohamed Ibrahim

06/30/2022, 7:17 PM
will take a look on it thanks 🙏
j

jw

06/30/2022, 7:17 PM
oh true. i guess it depends on what you want to do. i usually write a combination of string tests and then functional tests.
m

Mohamed Ibrahim

06/30/2022, 7:21 PM
@jw suppose I want to write a library for analytics events, supporting multiple providers like [Firebase - Facebook .. etc]. Do I need to test against the -generated- Analytics manager per se.
compilation failure is a way of testing if I’m not wrong. but what I’m searching for is a quicker feedback on the code I’m trying to generate.
m

Michal Klimczak

07/01/2022, 7:12 PM
This library is amazing, you can do much more than just checking if it compiles. However, it requires some workarounds if your generated code is from a ksp processor.