Add a compiler box test for Boolean.hashCode()

This commit is contained in:
Abduqodiri Qurbonzoda
2023-06-12 00:13:54 +03:00
committed by Space Team
parent 193aa0f935
commit 36924775c8
16 changed files with 114 additions and 0 deletions
@@ -35553,6 +35553,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/primitiveTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("booleanHashCode.kt")
public void testBooleanHashCode() throws Exception {
runTest("compiler/testData/codegen/box/primitiveTypes/booleanHashCode.kt");
}
@Test
@TestMetadata("comparisonWithNaN.kt")
public void testComparisonWithNaN() throws Exception {
@@ -35553,6 +35553,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/primitiveTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("booleanHashCode.kt")
public void testBooleanHashCode() throws Exception {
runTest("compiler/testData/codegen/box/primitiveTypes/booleanHashCode.kt");
}
@Test
@TestMetadata("comparisonWithNaN.kt")
public void testComparisonWithNaN() throws Exception {
@@ -0,0 +1,26 @@
// WITH_STDLIB
import kotlin.test.*
fun box() : String {
assertEquals(1231, true.hashCode())
assertEquals(1231, hashCode(true))
assertEquals(1237, false.hashCode())
assertEquals(1237, hashCode(false))
var b: Boolean? = null
assertEquals(0, b.hashCode())
assertEquals(0, hashCode(b))
b = true
assertEquals(1231, b.hashCode())
assertEquals(1231, hashCode(b))
b = false
assertEquals(1237, b.hashCode())
assertEquals(1237, hashCode(b))
return "OK"
}
fun hashCode(b: Boolean?): Int {
return b.hashCode()
}
@@ -33957,6 +33957,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/primitiveTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@Test
@TestMetadata("booleanHashCode.kt")
public void testBooleanHashCode() throws Exception {
runTest("compiler/testData/codegen/box/primitiveTypes/booleanHashCode.kt");
}
@Test
@TestMetadata("comparisonWithNaN.kt")
public void testComparisonWithNaN() throws Exception {
@@ -35553,6 +35553,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/primitiveTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("booleanHashCode.kt")
public void testBooleanHashCode() throws Exception {
runTest("compiler/testData/codegen/box/primitiveTypes/booleanHashCode.kt");
}
@Test
@TestMetadata("comparisonWithNaN.kt")
public void testComparisonWithNaN() throws Exception {
@@ -35553,6 +35553,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/primitiveTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
}
@Test
@TestMetadata("booleanHashCode.kt")
public void testBooleanHashCode() throws Exception {
runTest("compiler/testData/codegen/box/primitiveTypes/booleanHashCode.kt");
}
@Test
@TestMetadata("comparisonWithNaN.kt")
public void testComparisonWithNaN() throws Exception {
@@ -29023,6 +29023,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/primitiveTypes"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
}
@TestMetadata("booleanHashCode.kt")
public void testBooleanHashCode() throws Exception {
runTest("compiler/testData/codegen/box/primitiveTypes/booleanHashCode.kt");
}
@TestMetadata("comparisonWithNaN.kt")
public void testComparisonWithNaN() throws Exception {
runTest("compiler/testData/codegen/box/primitiveTypes/comparisonWithNaN.kt");