Skip to content

Commit 331a263

Browse files
authored
Merge branch 'main' into add-summary
2 parents eb8512f + 70ad733 commit 331a263

File tree

13 files changed

+274
-46
lines changed

13 files changed

+274
-46
lines changed

.github/workflows/check-deprecated-exercises.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ name: Deprecated
22

33
on:
44
pull_request:
5+
paths:
6+
- "exercises/**"
7+
push:
8+
branches:
9+
- main
10+
workflow_dispatch:
511

612
jobs:
713
test-deprecated:

exercises/practice/crypto-square/.meta/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"sshine",
2222
"stkent",
2323
"vdemeester",
24+
"Xinri",
2425
"Zaldrick"
2526
],
2627
"files": {

exercises/practice/crypto-square/.meta/tests.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ description = "8 character plaintext results in 3 chunks, the last one with a tr
3232

3333
[fbcb0c6d-4c39-4a31-83f6-c473baa6af80]
3434
description = "54 character plaintext results in 7 chunks, the last two with trailing spaces"
35+
include = false
36+
37+
[33fd914e-fa44-445b-8f38-ff8fbc9fe6e6]
38+
description = "54 character plaintext results in 8 chunks, the last two with trailing spaces"
39+
reimplements = "fbcb0c6d-4c39-4a31-83f6-c473baa6af80"

exercises/practice/crypto-square/src/test/java/CryptoSquareTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ public void eightCharacterPlaintextResultsInThreeChunksWithATrailingSpace() {
7777

7878
@Disabled("Remove to run test")
7979
@Test
80-
@DisplayName("54 character plaintext results in 7 chunks, the last two with trailing spaces")
81-
public void fiftyFourCharacterPlaintextResultsInSevenChunksWithTrailingSpaces() {
80+
@DisplayName("54 character plaintext results in 8 chunks, the last two with trailing spaces")
81+
public void fiftyFourCharacterPlaintextResultsInEightChunksWithTrailingSpaces() {
8282
CryptoSquare cryptoSquare = new CryptoSquare("If man was meant to stay on the ground, god would have " +
8383
"given us roots.");
8484
String expectedOutput = "imtgdvs fearwer mayoogo anouuio ntnnlvt wttddes aohghn sseoau ";

exercises/practice/two-bucket/.meta/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"muzimuzhi",
1515
"sjwarner-bp",
1616
"SleeplessByte",
17-
"sshine"
17+
"sshine",
18+
"Xinri"
1819
],
1920
"files": {
2021
"solution": [

exercises/practice/two-bucket/.meta/tests.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@ description = "Measure one step using bucket one of size 1 and bucket two of siz
2727
[eb329c63-5540-4735-b30b-97f7f4df0f84]
2828
description = "Measure using bucket one of size 2 and bucket two of size 3 - start with bucket one and end with bucket two"
2929

30+
[58d70152-bf2b-46bb-ad54-be58ebe94c03]
31+
description = "Measure using bucket one much bigger than bucket two"
32+
33+
[9dbe6499-caa5-4a58-b5ce-c988d71b8981]
34+
description = "Measure using bucket one much smaller than bucket two"
35+
3036
[449be72d-b10a-4f4b-a959-ca741e333b72]
3137
description = "Not possible to reach the goal"
3238

exercises/practice/two-bucket/src/test/java/TwoBucketTest.java

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import org.junit.jupiter.api.Disabled;
2+
import org.junit.jupiter.api.DisplayName;
23
import org.junit.jupiter.api.Test;
34

45
import static org.assertj.core.api.Assertions.assertThat;
@@ -7,6 +8,7 @@
78
public class TwoBucketTest {
89

910
@Test
11+
@DisplayName("Measure using bucket one of size 3 and bucket two of size 5 - start with bucket one")
1012
public void testBucketOneSizeThreeBucketTwoSizeFiveStartWithOne() {
1113

1214
Result bucketResult = new TwoBucket(3, 5, 1, "one").getResult();
@@ -19,6 +21,7 @@ public void testBucketOneSizeThreeBucketTwoSizeFiveStartWithOne() {
1921

2022
@Disabled("Remove to run test")
2123
@Test
24+
@DisplayName("Measure using bucket one of size 3 and bucket two of size 5 - start with bucket two")
2225
public void testBucketOneSizeThreeBucketTwoSizeFiveStartWithTwo() {
2326

2427
Result bucketResult = new TwoBucket(3, 5, 1, "two").getResult();
@@ -31,6 +34,7 @@ public void testBucketOneSizeThreeBucketTwoSizeFiveStartWithTwo() {
3134

3235
@Disabled("Remove to run test")
3336
@Test
37+
@DisplayName("Measure using bucket one of size 7 and bucket two of size 11 - start with bucket one")
3438
public void testBucketOneSizeSevenBucketTwoSizeElevenStartWithOne() {
3539

3640
Result bucketResult = new TwoBucket(7, 11, 2, "one").getResult();
@@ -43,6 +47,7 @@ public void testBucketOneSizeSevenBucketTwoSizeElevenStartWithOne() {
4347

4448
@Disabled("Remove to run test")
4549
@Test
50+
@DisplayName("Measure using bucket one of size 7 and bucket two of size 11 - start with bucket two")
4651
public void testBucketOneSizeSevenBucketTwoSizeElevenStartWithTwo() {
4752

4853
Result bucketResult = new TwoBucket(7, 11, 2, "two").getResult();
@@ -55,6 +60,7 @@ public void testBucketOneSizeSevenBucketTwoSizeElevenStartWithTwo() {
5560

5661
@Disabled("Remove to run test")
5762
@Test
63+
@DisplayName("Measure one step using bucket one of size 1 and bucket two of size 3 - start with bucket two")
5864
public void testBucketOneSizeOneBucketTwoSizeThreeStartWithTwo() {
5965

6066
Result bucketResult = new TwoBucket(1, 3, 3, "two").getResult();
@@ -67,6 +73,10 @@ public void testBucketOneSizeOneBucketTwoSizeThreeStartWithTwo() {
6773

6874
@Disabled("Remove to run test")
6975
@Test
76+
@DisplayName(
77+
"Measure using bucket one of size 2 and bucket two of size 3 - " +
78+
"start with bucket one and end with bucket two"
79+
)
7080
public void testBucketOneSizeTwoBucketTwoSizeThreeStartWithOne() {
7181

7282
Result bucketResult = new TwoBucket(2, 3, 3, "one").getResult();
@@ -79,15 +89,43 @@ public void testBucketOneSizeTwoBucketTwoSizeThreeStartWithOne() {
7989

8090
@Disabled("Remove to run test")
8191
@Test
92+
@DisplayName("Measure using bucket one much bigger than bucket two")
93+
public void testBucketOneMuchBiggerThanBucketTwo() {
94+
95+
Result bucketResult = new TwoBucket(5, 1, 2, "one").getResult();
96+
97+
assertThat(bucketResult.getTotalMoves()).isEqualTo(6);
98+
assertThat(bucketResult.getFinalBucket()).isEqualTo("one");
99+
assertThat(bucketResult.getOtherBucket()).isEqualTo(1);
100+
101+
}
102+
103+
@Disabled("Remove to run test")
104+
@Test
105+
@DisplayName("Measure using bucket one much smaller than bucket two")
106+
public void testBucketOneMuchSmallerThanBucketTwo() {
107+
108+
Result bucketResult = new TwoBucket(3, 15, 9, "one").getResult();
109+
110+
assertThat(bucketResult.getTotalMoves()).isEqualTo(6);
111+
assertThat(bucketResult.getFinalBucket()).isEqualTo("two");
112+
assertThat(bucketResult.getOtherBucket()).isEqualTo(0);
113+
114+
}
115+
116+
@Disabled("Remove to run test")
117+
@Test
118+
@DisplayName("Not possible to reach the goal")
82119
public void testReachingGoalIsImpossible() {
83-
120+
84121
assertThatExceptionOfType(UnreachableGoalException.class)
85122
.isThrownBy(() -> new TwoBucket(6, 15, 5, "one").getResult());
86123

87124
}
88125

89126
@Disabled("Remove to run test")
90127
@Test
128+
@DisplayName("With the same buckets but a different goal, then it is possible")
91129
public void testBucketOneSizeSixBucketTwoSizeFifteenStartWithOne() {
92130

93131
Result bucketResult = new TwoBucket(6, 15, 9, "one").getResult();
@@ -96,10 +134,11 @@ public void testBucketOneSizeSixBucketTwoSizeFifteenStartWithOne() {
96134
assertThat(bucketResult.getFinalBucket()).isEqualTo("two");
97135
assertThat(bucketResult.getOtherBucket()).isEqualTo(0);
98136

99-
}
137+
}
100138

101139
@Disabled("Remove to run test")
102140
@Test
141+
@DisplayName("Goal larger than both buckets is impossible")
103142
public void testGoalLargerThanBothBucketsIsImpossible() {
104143

105144
assertThatExceptionOfType(UnreachableGoalException.class)

exercises/practice/variable-length-quantity/.meta/config.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"muzimuzhi",
1313
"SleeplessByte",
1414
"sshine",
15-
"vpondala"
15+
"vpondala",
16+
"Xinri"
1617
],
1718
"files": {
1819
"solution": [
Lines changed: 51 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,103 @@
1-
# This is an auto-generated file. Regular comments will be removed when this
2-
# file is regenerated. Regenerating will not touch any manually added keys,
3-
# so comments can be added in a "comment" key.
1+
# This is an auto-generated file.
2+
#
3+
# Regenerating this file via `configlet sync` will:
4+
# - Recreate every `description` key/value pair
5+
# - Recreate every `reimplements` key/value pair, where they exist in problem-specifications
6+
# - Remove any `include = true` key/value pair (an omitted `include` key implies inclusion)
7+
# - Preserve any other key/value pair
8+
#
9+
# As user-added comments (using the # character) will be removed when this file
10+
# is regenerated, comments can be added via a `comment` key.
411

512
[35c9db2e-f781-4c52-b73b-8e76427defd0]
6-
description = "zero"
13+
description = "Encode a series of integers, producing a series of bytes. -> zero"
714

815
[be44d299-a151-4604-a10e-d4b867f41540]
9-
description = "arbitrary single byte"
16+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary single byte"
17+
18+
[890bc344-cb80-45af-b316-6806a6971e81]
19+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric single byte"
1020

1121
[ea399615-d274-4af6-bbef-a1c23c9e1346]
12-
description = "largest single byte"
22+
description = "Encode a series of integers, producing a series of bytes. -> largest single byte"
1323

1424
[77b07086-bd3f-4882-8476-8dcafee79b1c]
15-
description = "smallest double byte"
25+
description = "Encode a series of integers, producing a series of bytes. -> smallest double byte"
1626

1727
[63955a49-2690-4e22-a556-0040648d6b2d]
18-
description = "arbitrary double byte"
28+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary double byte"
29+
30+
[4977d113-251b-4d10-a3ad-2f5a7756bb58]
31+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric double byte"
1932

2033
[29da7031-0067-43d3-83a7-4f14b29ed97a]
21-
description = "largest double byte"
34+
description = "Encode a series of integers, producing a series of bytes. -> largest double byte"
2235

2336
[3345d2e3-79a9-4999-869e-d4856e3a8e01]
24-
description = "smallest triple byte"
37+
description = "Encode a series of integers, producing a series of bytes. -> smallest triple byte"
2538

2639
[5df0bc2d-2a57-4300-a653-a75ee4bd0bee]
27-
description = "arbitrary triple byte"
40+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary triple byte"
41+
42+
[6731045f-1e00-4192-b5ae-98b22e17e9f7]
43+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric triple byte"
2844

2945
[f51d8539-312d-4db1-945c-250222c6aa22]
30-
description = "largest triple byte"
46+
description = "Encode a series of integers, producing a series of bytes. -> largest triple byte"
3147

3248
[da78228b-544f-47b7-8bfe-d16b35bbe570]
33-
description = "smallest quadruple byte"
49+
description = "Encode a series of integers, producing a series of bytes. -> smallest quadruple byte"
3450

3551
[11ed3469-a933-46f1-996f-2231e05d7bb6]
36-
description = "arbitrary quadruple byte"
52+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quadruple byte"
53+
54+
[b45ef770-cbba-48c2-bd3c-c6362679516e]
55+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quadruple byte"
3756

3857
[d5f3f3c3-e0f1-4e7f-aad0-18a44f223d1c]
39-
description = "largest quadruple byte"
58+
description = "Encode a series of integers, producing a series of bytes. -> largest quadruple byte"
4059

4160
[91a18b33-24e7-4bfb-bbca-eca78ff4fc47]
42-
description = "smallest quintuple byte"
61+
description = "Encode a series of integers, producing a series of bytes. -> smallest quintuple byte"
4362

4463
[5f34ff12-2952-4669-95fe-2d11b693d331]
45-
description = "arbitrary quintuple byte"
64+
description = "Encode a series of integers, producing a series of bytes. -> arbitrary quintuple byte"
65+
66+
[9be46731-7cd5-415c-b960-48061cbc1154]
67+
description = "Encode a series of integers, producing a series of bytes. -> asymmetric quintuple byte"
4668

4769
[7489694b-88c3-4078-9864-6fe802411009]
48-
description = "maximum 32-bit integer input"
70+
description = "Encode a series of integers, producing a series of bytes. -> maximum 32-bit integer input"
4971

5072
[f9b91821-cada-4a73-9421-3c81d6ff3661]
51-
description = "two single-byte values"
73+
description = "Encode a series of integers, producing a series of bytes. -> two single-byte values"
5274

5375
[68694449-25d2-4974-ba75-fa7bb36db212]
54-
description = "two multi-byte values"
76+
description = "Encode a series of integers, producing a series of bytes. -> two multi-byte values"
5577

5678
[51a06b5c-de1b-4487-9a50-9db1b8930d85]
57-
description = "many multi-byte values"
79+
description = "Encode a series of integers, producing a series of bytes. -> many multi-byte values"
5880

5981
[baa73993-4514-4915-bac0-f7f585e0e59a]
60-
description = "one byte"
82+
description = "Decode a series of bytes, producing a series of integers. -> one byte"
6183

6284
[72e94369-29f9-46f2-8c95-6c5b7a595aee]
63-
description = "two bytes"
85+
description = "Decode a series of bytes, producing a series of integers. -> two bytes"
6486

6587
[df5a44c4-56f7-464e-a997-1db5f63ce691]
66-
description = "three bytes"
88+
description = "Decode a series of bytes, producing a series of integers. -> three bytes"
6789

6890
[1bb58684-f2dc-450a-8406-1f3452aa1947]
69-
description = "four bytes"
91+
description = "Decode a series of bytes, producing a series of integers. -> four bytes"
7092

7193
[cecd5233-49f1-4dd1-a41a-9840a40f09cd]
72-
description = "maximum 32-bit integer"
94+
description = "Decode a series of bytes, producing a series of integers. -> maximum 32-bit integer"
7395

7496
[e7d74ba3-8b8e-4bcb-858d-d08302e15695]
75-
description = "incomplete sequence causes error"
97+
description = "Decode a series of bytes, producing a series of integers. -> incomplete sequence causes error"
7698

7799
[aa378291-9043-4724-bc53-aca1b4a3fcb6]
78-
description = "incomplete sequence causes error, even if value is zero"
100+
description = "Decode a series of bytes, producing a series of integers. -> incomplete sequence causes error, even if value is zero"
79101

80102
[a91e6f5a-c64a-48e3-8a75-ce1a81e0ebee]
81-
description = "multiple values"
103+
description = "Decode a series of bytes, producing a series of integers. -> multiple values"

0 commit comments

Comments
 (0)