Skip to content

Commit b1e9fba

Browse files
authored
Update tests collatz conjecture (#2581)
* Updating tests collatz-conjecture * updating proof.ci.js for collatz-conjecture
1 parent 4cb770c commit b1e9fba

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

exercises/practice/collatz-conjecture/.meta/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"authors": [],
33
"contributors": [
44
"ankorGH",
5+
"jagdish-15",
56
"rchavarria",
67
"SleeplessByte",
78
"xarxziux"

exercises/practice/collatz-conjecture/.meta/proof.ci.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const steps = (n) => {
22
if (n <= 0) {
3-
throw new Error('Only positive numbers are allowed');
3+
throw new Error('Only positive integers are allowed');
44
}
55

66
const iterate = (number, step) => {

exercises/practice/collatz-conjecture/.meta/tests.toml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
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
[540a3d51-e7a6-47a5-92a3-4ad1838f0bfd]
613
description = "zero steps for one"
@@ -16,6 +23,16 @@ description = "large number of even and odd steps"
1623

1724
[7d4750e6-def9-4b86-aec7-9f7eb44f95a3]
1825
description = "zero is an error"
26+
include = false
27+
28+
[2187673d-77d6-4543-975e-66df6c50e2da]
29+
description = "zero is an error"
30+
reimplements = "7d4750e6-def9-4b86-aec7-9f7eb44f95a3"
1931

2032
[c6c795bf-a288-45e9-86a1-841359ad426d]
2133
description = "negative value is an error"
34+
include = false
35+
36+
[ec11f479-56bc-47fd-a434-bcd7a31a7a2e]
37+
description = "negative value is an error"
38+
reimplements = "c6c795bf-a288-45e9-86a1-841359ad426d"

exercises/practice/collatz-conjecture/collatz-conjecture.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ describe('steps()', () => {
2121
xtest('zero is an error', () => {
2222
expect(() => {
2323
steps(0);
24-
}).toThrow(new Error('Only positive numbers are allowed'));
24+
}).toThrow(new Error('Only positive integers are allowed'));
2525
});
2626

2727
xtest('negative value is an error', () => {
2828
expect(() => {
2929
steps(-15);
30-
}).toThrow(new Error('Only positive numbers are allowed'));
30+
}).toThrow(new Error('Only positive integers are allowed'));
3131
});
3232
});

0 commit comments

Comments
 (0)