void () { VirtualFile testDataRoot = ModuleRootManager.getInstance(myModule).getContentRoots()[0]; Module a = createModule("a"); PsiTestUtil.addContentRoot(a, testDataRoot.findFileByRelativePath("a")); Module main = createModule("a.main"); PsiTestUtil.addContentRoot(main, testDataRoot.findFileByRelativePath("a/main")); Module foo = createModule("a.foo"); PsiTestUtil.addContentRoot(foo, testDataRoot.findFileByRelativePath("a/Foo")); Module util = createModule("util"); PsiTestUtil.addContentRoot(util, testDataRoot.findFileByRelativePath("a/util")); Module b = createModule("x.b"); PsiTestUtil.addContentRoot(b, testDataRoot.findFileByRelativePath("a/b")); myStructure.setShowLibraryContents(false); //todo this function is generic enough, it can be moved to testFramework Function<Object, String> nodePresenter = o -> { AbstractTreeNode node = (AbstractTreeNode)o; node.update(); PresentationData presentation = node.getPresentation(); List<PresentableNodeDescriptor.ColoredFragment> fragments = presentation.getColoredText(); if (fragments.isEmpty()) { return presentation.getPresentableText(); } return StringUtil.join(fragments, PresentableNodeDescriptor.ColoredFragment::getText, ""); }; String treeStructure = ModuleGroupTestsKt.runWithQualifiedModuleNamesEnabled(() -> PlatformTestUtil.print(myStructure, myStructure.getRootElement(), nodePresenter)); assertEquals(""" testQualifiedModuleNames qualifiedModuleNames [testQualifiedModuleNames] a Foo foo.txt b [x.b] b.txt main main.txt util util.txt """, treeStructure); }