use of kotlin.text.MatchResult in project kotlin by JetBrains.
the class KotlinIntegrationTestBase method normalizePath.
private static String normalizePath(String content, File baseDir, String pathId) {
String contentWithRelativePaths = content.replace(baseDir.getAbsolutePath(), pathId);
@Language("RegExp") String RELATIVE_PATH_WITH_MIXED_SEPARATOR = Regex.Companion.escape(pathId) + "[-.\\w/\\\\]*";
return new Regex(RELATIVE_PATH_WITH_MIXED_SEPARATOR).replace(contentWithRelativePaths, new Function1<MatchResult, String>() {
@Override
public String invoke(MatchResult mr) {
return FileUtil.toSystemIndependentName(mr.getValue());
}
});
}
Aggregations