How can I test a compiler plugin?

I am making a compiler plugin and would like to test it.
I don’t know how to access the functions defined inside the plugin.

The structure is such that there is an outer class which contains a Component object which contains the inner class I want to test.

I can create the outer class in a scalatest and access the components array but I can’t seem to find a way to access the inner class or its functions.

Is there some way to do this?



So is there no way to do unit tests on functions inside the plugin? You just have to treat it as a black box?

What’s the problem to make PluginComponent not private and not inner if you want to test it?

1 Like