Skip to content

Commit

Permalink
Fix the build on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolkensteyn committed Mar 18, 2016
1 parent 29ec29c commit 035d5a0
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/test/java/org/sonar/plugins/csharp/SarifParserTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.sonar.plugins.csharp;

import java.io.File;
import org.apache.commons.lang.SystemUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
Expand Down Expand Up @@ -64,8 +65,8 @@ public void sarif_version_0_1() {

InOrder inOrder = inOrder(callback);

inOrder.verify(callback).onIssue("S1172", "C:\\Foo.cs", "Remove this unused method parameter \"args\".", 43);
inOrder.verify(callback).onIssue("CA1000", "C:\\Bar.cs", "There is just a full message.", 2);
inOrder.verify(callback).onIssue("S1172", normalize("C:\\Foo.cs"), "Remove this unused method parameter \"args\".", 43);
inOrder.verify(callback).onIssue("CA1000", normalize("C:\\Bar.cs"), "There is just a full message.", 2);
inOrder.verify(callback).onProjectIssue("AssemblyLevelRule", "This is an assembly level Roslyn issue with no location.");
inOrder.verify(callback).onProjectIssue("NoAnalysisTargetsLocation", "No analysis targets, report at assembly level.");
inOrder.verifyNoMoreInteractions();
Expand All @@ -79,8 +80,16 @@ public void sarif_version_0_4() {

InOrder inOrder = inOrder(callback);

inOrder.verify(callback).onIssue("S125", "C:\\Foo.cs", "Remove this commented out code.", 58);
inOrder.verify(callback).onIssue("S125", normalize("C:\\Foo.cs"), "Remove this commented out code.", 58);
inOrder.verifyNoMoreInteractions();
}

private static String normalize(String path) {
if (SystemUtils.IS_OS_WINDOWS) {
return path;
}

return "/" + path.replace('\\', '/');
}

}

0 comments on commit 035d5a0

Please sign in to comment.