Skip to content

Commit 56b0d79

Browse files
authored
Sync tests for practice exercise prime factors (exercism#2613)
1 parent 3cb37cd commit 56b0d79

2 files changed

Lines changed: 55 additions & 3 deletions

File tree

exercises/practice/prime-factors/.meta/tests.toml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,41 @@
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
[924fc966-a8f5-4288-82f2-6b9224819ccd]
613
description = "no factors"
714

815
[17e30670-b105-4305-af53-ddde182cb6ad]
916
description = "prime number"
1017

18+
[238d57c8-4c12-42ef-af34-ae4929f94789]
19+
description = "another prime number"
20+
1121
[f59b8350-a180-495a-8fb1-1712fbee1158]
1222
description = "square of a prime"
1323

24+
[756949d3-3158-4e3d-91f2-c4f9f043ee70]
25+
description = "product of first prime"
26+
1427
[bc8c113f-9580-4516-8669-c5fc29512ceb]
1528
description = "cube of a prime"
1629

30+
[7d6a3300-a4cb-4065-bd33-0ced1de6cb44]
31+
description = "product of second prime"
32+
33+
[073ac0b2-c915-4362-929d-fc45f7b9a9e4]
34+
description = "product of third prime"
35+
36+
[6e0e4912-7fb6-47f3-a9ad-dbcd79340c75]
37+
description = "product of first and second prime"
38+
1739
[00485cd3-a3fe-4fbe-a64a-a4308fc1f870]
1840
description = "product of primes and non-primes"
1941

exercises/practice/prime-factors/src/test/java/PrimeFactorsCalculatorTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,48 @@ public void testPrimeNumber() {
2424
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(2L)).containsExactly(2L);
2525
}
2626

27+
@Ignore("Remove to run test")
28+
@Test
29+
public void testAnotherPrimeNumber() {
30+
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(3L)).containsExactly(3L);
31+
}
32+
2733
@Ignore("Remove to run test")
2834
@Test
2935
public void testSquareOfAPrime() {
3036
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(9L)).containsExactly(3L, 3L);
3137
}
3238

39+
@Ignore("Remove to run test")
40+
@Test
41+
public void testProductOfFirstPrime() {
42+
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(4L)).containsExactly(2L, 2L);
43+
}
44+
3345
@Ignore("Remove to run test")
3446
@Test
3547
public void testCubeOfAPrime() {
3648
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(8L)).containsExactly(2L, 2L, 2L);
3749
}
3850

51+
@Ignore("Remove to run test")
52+
@Test
53+
public void testProductOfSecondPrime() {
54+
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(625L)).containsExactly(5L, 5L, 5L, 5L);
55+
}
56+
57+
@Ignore("Remove to run test")
58+
@Test
59+
public void testProductOfThirdPrime() {
60+
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(27L)).containsExactly(3L, 3L, 3L);
61+
}
62+
63+
@Ignore("Remove to run test")
64+
@Test
65+
public void testProductOfFirstAndSecondPrime() {
66+
assertThat(primeFactorsCalculator.calculatePrimeFactorsOf(6L)).containsExactly(2L, 3L);
67+
}
68+
3969
@Ignore("Remove to run test")
4070
@Test
4171
public void testProductOfPrimesAndNonPrimes() {

0 commit comments

Comments
 (0)