Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add unit tests (#452)
  • Loading branch information
mmvpm committed Jul 8, 2022
commit ff2d2d12994603444446d7de3dc4dea33d13fa3a
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class SarifReportTest {
assert(location.region.startLine == 1337)
assert(relatedLocation.artifactLocation.uri.contains("MainTest.java"))
assert(relatedLocation.region.startLine == 1)
assert(relatedLocation.region.startColumn == 1)
}

@Test
Expand Down Expand Up @@ -158,6 +159,7 @@ class SarifReportTest {
}
assert(codeFlowPhysicalLocations[0].artifactLocation.uri.contains("MainTest.java"))
assert(codeFlowPhysicalLocations[0].region.startLine == 3)
assert(codeFlowPhysicalLocations[0].region.startColumn == 7)
}

@Test
Expand All @@ -181,6 +183,7 @@ class SarifReportTest {
}
assert(codeFlowPhysicalLocations[0].artifactLocation.uri.contains("MainTest.java"))
assert(codeFlowPhysicalLocations[0].region.startLine == 4)
assert(codeFlowPhysicalLocations[0].region.startColumn == 5)
}

// internal
Expand Down Expand Up @@ -217,7 +220,7 @@ class SarifReportTest {
private val generatedTestsCodeMain = """
public void testMain_ThrowArithmeticException() {
Main main = new Main();
main.main(0);
main.main(0); // shift for `startColumn` == 7
}
""".trimIndent()

Expand Down