Skip to content

Commit 381f938

Browse files
authored
Added tests 67, 68.
1 parent 30adcf1 commit 381f938

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

src.save/test/java/g0001_0100/s0067_add_binary/SolutionTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ class SolutionTest {
1010
void addBinary() {
1111
assertThat(new Solution().addBinary("11", "1"), equalTo("100"));
1212
}
13+
14+
@Test
15+
void addBinary2() {
16+
assertThat(new Solution().addBinary("1010", "1011"), equalTo("10101"));
17+
}
1318
}

src.save/test/java/g0001_0100/s0068_text_justification/SolutionTest.java

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,55 @@ void fullJustify() {
1313
String[] input =
1414
new String[] {"This", "is", "an", "example", "of", "text", "justification."};
1515
List<String> actual = new Solution().fullJustify(input, 16);
16-
1716
List<String> expected = new ArrayList<>();
1817
expected.add("This is an");
1918
expected.add("example of text");
2019
expected.add("justification. ");
20+
assertThat(actual, equalTo(expected));
21+
}
22+
23+
@Test
24+
void fullJustify2() {
25+
String[] input = new String[] {"What", "must", "be", "acknowledgment", "shall", "be"};
26+
List<String> actual = new Solution().fullJustify(input, 16);
27+
List<String> expected = new ArrayList<>();
28+
expected.add("What must be");
29+
expected.add("acknowledgment ");
30+
expected.add("shall be ");
31+
assertThat(actual, equalTo(expected));
32+
}
2133

34+
@Test
35+
void fullJustify3() {
36+
String[] input =
37+
new String[] {
38+
"Science",
39+
"is",
40+
"what",
41+
"we",
42+
"understand",
43+
"well",
44+
"enough",
45+
"to",
46+
"explain",
47+
"to",
48+
"a",
49+
"computer.",
50+
"Art",
51+
"is",
52+
"everything",
53+
"else",
54+
"we",
55+
"do"
56+
};
57+
List<String> actual = new Solution().fullJustify(input, 20);
58+
List<String> expected = new ArrayList<>();
59+
expected.add("Science is what we");
60+
expected.add("understand well");
61+
expected.add("enough to explain to");
62+
expected.add("a computer. Art is");
63+
expected.add("everything else we");
64+
expected.add("do ");
2265
assertThat(actual, equalTo(expected));
2366
}
2467
}

0 commit comments

Comments
 (0)