From b2a2e4ae929276d1341bf92c4ca4d350875bd8cd Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Wed, 15 Apr 2015 21:06:58 +0300 Subject: [PATCH] Add bytecodeText test for annotation with default value It checks that no value is emitted if argument is not specified --- .../testData/codegen/bytecodeText/annotationDefaultValue.kt | 5 +++++ .../jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt diff --git a/compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt b/compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt new file mode 100644 index 00000000000..09991929306 --- /dev/null +++ b/compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt @@ -0,0 +1,5 @@ +annotation class Ann(val arg: String = "abc") + +Ann class MyClass + +// 1 @LAnn;\(\) diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java index 6a4201ba2e0..0d69120b512 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BytecodeTextTestGenerated.java @@ -41,6 +41,12 @@ public class BytecodeTextTestGenerated extends AbstractBytecodeTextTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/codegen/bytecodeText"), Pattern.compile("^(.+)\\.kt$"), true); } + @TestMetadata("annotationDefaultValue.kt") + public void testAnnotationDefaultValue() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/annotationDefaultValue.kt"); + doTest(fileName); + } + @TestMetadata("annotationRetentionPolicyClass.kt") public void testAnnotationRetentionPolicyClass() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/codegen/bytecodeText/annotationRetentionPolicyClass.kt");