Add additional test to see if relative paths are expanded.
See
@@ -169,6 +169,18 @@ class IssueTest extends SerializableTest<Issue> {
assertThat(issue).hasPath("C:/Another/Path");
}
+ @Test
+ void shouldExpandPath() {
+ Report report = new Report();
+ Issue issue = new IssueBuilder()
+ .setPathName("/jenkins-data/jenkins/workspace/root/trunk/sw/build")
+ .setFileName("../../component/app/_src/file.c")
+ .build();
+ report.add(issue);
+
+ assertThat(issue.getAbsolutePath()).isEqualTo("/jenkins-data/jenkins/workspace/root/trunk/component/app/_src/file.c");
+ }
+
@Test
void shouldEnsureThatEndIsGreaterOrEqualStart() {
Issue issue = new Issue(PATH_NAME, FILE_NAME_TS, 2, 1, 2, 1, LINE_RANGES, CATEGORY,
