Skip to content

Commit edb5e9d

Browse files
committed
Added new test to test 58 and missing printCoverage before return 0 on _58.java
1 parent 9e960a0 commit edb5e9d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

Diff for: src/main/java/com/fishercoder/solutions/_58.java

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public static class Solution1 {
1414
public int lengthOfLastWord(String s) {
1515
if (s == null || s.length() == 0) {
1616
branchCoverage.put("flag1", true);
17+
printCoverage();
1718
return 0;
1819
}
1920
s = s.trim();

Diff for: src/test/java/com/fishercoder/_58Test.java

+5
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,9 @@ public void setup() {
1818
public void test1() {
1919
assertEquals(5, solution1.lengthOfLastWord("Hello World"));
2020
}
21+
22+
@Test
23+
public void CeciliaTest() {
24+
assertEquals(0, solution1.lengthOfLastWord(null));
25+
}
2126
}

0 commit comments

Comments
 (0)