Skip to content

Commit 0ce13be

Browse files
authored
refactor: revise obsolete kata logic (#854)
Solve the problem in less than 80 characters.
1 parent fbe3e3b commit 0ce13be

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
class StrangeString {
2-
static final String STRANGE_STRING = "ß";
3-
4-
private StrangeString() {}
1+
interface StrangeString {
2+
String STRANGE_STRING = "ß";
53
}

kata/8-kyu/up-and-down-the-string-grows/test/SolutionTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import static org.junit.jupiter.api.Assertions.assertEquals;
2+
import static org.junit.jupiter.api.Assertions.assertTrue;
23

4+
import java.nio.file.Files;
5+
import java.nio.file.Path;
6+
import java.nio.file.Paths;
37
import org.junit.jupiter.api.Test;
48

59
class SolutionTest {
@@ -8,4 +12,11 @@ void sample() {
812
String upDown = StrangeString.STRANGE_STRING.toUpperCase().toLowerCase();
913
assertEquals(StrangeString.STRANGE_STRING.length() + 1, upDown.length());
1014
}
15+
16+
@Test
17+
void solutionSize() throws Exception {
18+
Path current = Paths.get("").toAbsolutePath();
19+
Path solution = current.resolve("main/StrangeString.java");
20+
assertTrue(Files.size(solution) < 81, "Solution should be 80 characters max.");
21+
}
1122
}

0 commit comments

Comments
 (0)