Skip to content

Commit 4d07cab

Browse files
committed
[javasrc2cpg] Parse enums correctly when keepTypeArguments is enabled
Signed-off-by: ricekot <git@ricekot.com>
1 parent c5c8ef5 commit 4d07cab

File tree

1 file changed

+12
-0
lines changed
  • joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying

1 file changed

+12
-0
lines changed

joern-cli/frontends/javasrc2cpg/src/test/scala/io/joern/javasrc2cpg/querying/VarDeclTests.scala

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,18 @@ class VarDeclTests extends JavaSrcCode2CpgFixture {
206206
.head shouldBe "org.apache.flink.streaming.connectors.kafka.FlinkKafkaProducer.<init>:<unresolvedSignature>(3)"
207207
}
208208

209+
"parse enums correctly" in {
210+
val cpg = code(
211+
"""
212+
|public enum Color {
213+
| RED,
214+
| GREEN,
215+
| BLUE
216+
|}
217+
|""".stripMargin).withConfig(Config().withKeepTypeArguments(true))
218+
219+
cpg.typeDecl("Color").code.head shouldBe "public enum Color"
220+
}
209221
}
210222

211223
}

0 commit comments

Comments
 (0)