JetBrains-Research / TestSpark

TestSpark - a plugin for generating unit tests. TestSpark natively integrates different AI-based test generation tools and techniques in the IDE. Started by SERG TU Delft. Currently under implementation by JetBrains Research (ICTL) for research purposes.
MIT License
35 stars 9 forks source link

[Java] Wrong enum class parsing #247

Open Frosendroska opened 1 month ago

Frosendroska commented 1 month ago

Description

There is a bug in PSI parsing, when there is a cursor inside enum.

// Enum definition
enum MyEnum {
    FIRST(1),
    SECOND(2),
    THIRD(3);

    private final int value;

    MyEnum(int value) {
        this.value = value;
    }

    public int getValue() {
        return value;
    }

    void enumMethod() {
        System.out.println("This is a method in an enum class.");
    }
}
  1. If the cursor is placed within an enum on a line containing text, the only option displayed in the window is the ability to test that specific line.
  2. When the cursor is in a blank line, there are no possible testing options displayed in the panel.