Replace hashes in bytecode listing tests with 'HASH'
This commit is contained in:
@@ -34,7 +34,7 @@ abstract class AbstractBytecodeListingTest : CodegenTestCase() {
|
||||
val cr = ClassReader(it.asByteArray())
|
||||
val visitor = TextCollectingVisitor()
|
||||
cr.accept(visitor, ClassReader.SKIP_CODE)
|
||||
visitor.text
|
||||
KotlinTestUtils.replaceHash(visitor.text, "HASH")
|
||||
}.joinToString("\n\n")
|
||||
|
||||
KotlinTestUtils.assertEqualsToFile(txtFile, generatedFiles)
|
||||
|
||||
@@ -950,10 +950,14 @@ public class KotlinTestUtils {
|
||||
|
||||
@NotNull
|
||||
public static String replaceHashWithStar(@NotNull String string) {
|
||||
return replaceHash(string, "*");
|
||||
}
|
||||
|
||||
public static String replaceHash(@NotNull String string, @NotNull String replacement) {
|
||||
//TODO: hashes are still used in SamWrapperCodegen
|
||||
Matcher matcher = STRIP_PACKAGE_PART_HASH_PATTERN.matcher(string);
|
||||
if (matcher.find()) {
|
||||
return matcher.replaceAll("\\$*");
|
||||
return matcher.replaceAll("\\$" + replacement);
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user