Skip to content

Commit c410a36

Browse files
committed
simplify test assertions
1 parent 454b27f commit c410a36

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

.idea/misc.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/test/java/com/scanoss/TestWinnowing.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public void TestWinnowingContents() {
102102
byte[] contents = "sample c code with lots of code that we should analyse\nAnd even more code to get connected.\nAnd we need to get this as long as possible, in order to trigger snippet matching.\nHere comes more code to help get this working.\nPlease help get this across the line. We need all the help we can get.\n".getBytes();
103103
String wfp = winnowing.wfpForContents("local-file.c", false, contents);
104104
assertNotNull(wfp);
105-
assertTrue(wfp.length() > 0);
105+
assertFalse(wfp.isEmpty());
106106
log.info("TestWinnowingContents - WFP contents: {}", wfp);
107107

108108
log.info("Finished {} -->", methodName);
@@ -118,13 +118,13 @@ public void TestWinnowingFiles() {
118118
String file = "testing/data/empty.java";
119119
String wfp = winnowing.wfpForFile(file, "testing/data/empty.java");
120120
assertNotNull("Expected a basic WFP here", wfp);
121-
assertTrue("Expected a basic WFP here", wfp.length() > 0);
121+
assertFalse("Expected a basic WFP here", wfp.isEmpty());
122122
log.info("TestWinnowingFiles - WFP contents - {}: {}", file, wfp);
123123

124124
file = "src/test/java/com/scanoss/TestWinnowing.java";
125125
wfp = winnowing.wfpForFile("src/test/java/com/scanoss/TestWinnowing.java", "TestWinnowing.java");
126126
assertNotNull("Expected a WFP here", wfp);
127-
assertTrue("Expected a basic WFP here", wfp.length() > 0);
127+
assertFalse("Expected a basic WFP here", wfp.isEmpty());
128128
assertTrue("Should have snippets here", snippetPat.matcher(wfp).find());
129129
log.info("TestWinnowingFiles - WFP contents - {}: {}", file, wfp);
130130

0 commit comments

Comments
 (0)