facebook/redex

DexClass is untestable

justhecuke opened this issue · 2 comments

I was trying to write some unit tests for SingleImplPass and realized that a key part of Redex is untestable: DexClass.

RIght now, I'm in the middle of lightly refactoring DexClass to kinda-sorta work in unit tests but I'm not sure on how willing you will be to pick up the change. Can I get some thoughts from the maintainers on what scope of changes you're willing to take or how you normally test passes that heavily use DexClass?

There are various unit tests that create DexClasses, and various other pieces of metadata on-the-fly as needed. See for example native/redex/test/unit/CheckCastAnalysisTest.cpp.

Ah, oh, seems like you guys also created a test helper that does basically the same as the thing I just wrote. I'll see if I can refactor my test to use ClassCreator. Thanks for the pointer.