Skip to content

Incorrect related location in SARIF report #1218

@mmvpm

Description

@mmvpm

Description

The "View generated test" button can't find the test method and refers to the first line of the test file

image

To Reproduce

Generate tests for

public class MyLinkedList {

    private Node head;
    private Node tail;

    public MyLinkedList(Node node) {
        head = node;
        tail = head;
    }

    public void add(Node node) {
        tail.setNext(node);
        tail = node;
    }

    public int[] toArray() {
        Node current = head;
        ArrayList<Integer> result = new ArrayList<>();
        result.add(head.value);
        while (current.hasNext()) {
            current = current.next;
            result.add(current.value);
        }
        return result.stream().mapToInt(Integer::intValue).toArray();
    }
}

Expected behavior

Link to the test file is correct.

Actual behavior

See the screenshot above

Metadata

Metadata

Labels

ctg-bugIssue is a bug

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions