Skip to content

Commit 5e1e05e

Browse files
authored
Syncing test.toml and updating the test code and the proof solutions for word-count (#2653)
* Syncing test.toml and updating the test code and the proof solutions * running format.mjs * Fixin wrong test name
1 parent d20eded commit 5e1e05e

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

exercises/practice/word-count/.meta/config.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"contributors": [
66
"ankorGH",
77
"draalger",
8+
"jagdish-15",
89
"kytrinyx",
910
"matthewmorgan",
1011
"ovidiu141",

exercises/practice/word-count/.meta/tests.toml

Lines changed: 18 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
[61559d5f-2cad-48fb-af53-d3973a9ee9ef]
613
description = "count one word"
@@ -28,6 +35,11 @@ description = "normalize case"
2835

2936
[4185a902-bdb0-4074-864c-f416e42a0f19]
3037
description = "with apostrophes"
38+
include = false
39+
40+
[4ff6c7d7-fcfc-43ef-b8e7-34ff1837a2d3]
41+
description = "with apostrophes"
42+
reimplements = "4185a902-bdb0-4074-864c-f416e42a0f19"
3143

3244
[be72af2b-8afe-4337-b151-b297202e4a7b]
3345
description = "with quotations"
@@ -40,3 +52,6 @@ description = "multiple spaces not detected as a word"
4052

4153
[50176e8a-fe8e-4f4c-b6b6-aa9cf8f20360]
4254
description = "alternating word separators not detected as a word"
55+
56+
[6d00f1db-901c-4bec-9829-d20eb3044557]
57+
description = "quotation for word with apostrophe"

exercises/practice/word-count/word-count.spec.js

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,13 @@ describe('countWords', () => {
8080
laugh: 1,
8181
then: 1,
8282
cry: 1,
83+
"you're": 1,
84+
getting: 1,
85+
it: 1,
8386
};
84-
expect(countWords("First: don't laugh. Then: don't cry.")).toEqual(
85-
expectedCounts,
86-
);
87+
expect(
88+
countWords("'First: don't laugh. Then: don't cry. You're getting it.'"),
89+
).toEqual(expectedCounts);
8790
});
8891

8992
xtest('with quotations', () => {
@@ -132,4 +135,12 @@ describe('countWords', () => {
132135
};
133136
expect(countWords(",\n,one,\n ,two \n 'three'")).toEqual(expectedCounts);
134137
});
138+
139+
xtest('quotation for word with apostrophe', () => {
140+
const expectedCounts = {
141+
can: 1,
142+
"can't": 2,
143+
};
144+
expect(countWords("can, can't, 'can't'")).toEqual(expectedCounts);
145+
});
135146
});

0 commit comments

Comments
 (0)