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

src/main/java/com/fishercoder/solutions/_58.java

Lines changed: 1 addition & 0 deletions
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();

src/test/java/com/fishercoder/_58Test.java

Lines changed: 5 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy