I ran into this problem yesterday and it resulted in me having to spend a few hours to refactor my project (should have only taken a few minutes).
I have a project setup like this:
src/java is marked as a source folder, and test/java is marked as test source folder.
I moved a lot of packages around to better organize it due some new developement. When I moved a package (using drag-n-drop) in src/java I got a warning about the move affecting both src/java and test/java (which would be expected). So I press Yes and IntelliJ does the refactor and when I look all the unit tests for that package are now
under src/java. i.e. it combined src/java and test/java instead of recognizing it was a different source path and just duplicating the package move under test/java.
Is this a bug or by design?
As a workaround it finally dawned on me to remove test/java as a test source location under project settings, then do the refactoring to src/java. Then I unselected src/java as a source location and reselected test/java and then duplicated my refactoring for test/java. This was ok, but defintely not pleasurable:-)