Skip to content

Commit 8d8589f

Browse files
author
Katrina Owen
authored
Merge pull request #403 from pvcarrera/add-word-count-cases
Add word count cases
2 parents fcdd7b4 + 43d62d1 commit 8d8589f

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

exercises/word-count/canonical-data.json

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,42 @@
1313
{
1414
"description": "multiple occurrences of a word",
1515
"input": "one fish two fish red fish blue fish",
16-
"expected": { "one" : 1, "fish" : 4, "two" : 1, "red" : 1, "blue" : 1 }
16+
"expected": { "one": 1, "fish": 4, "two": 1, "red": 1, "blue": 1 }
17+
},
18+
{
19+
"description": "handles cramped lists",
20+
"input": "one,two,three",
21+
"expected": { "one": 1, "two": 1, "three": 1 }
22+
},
23+
{
24+
"description": "handles expanded lists",
25+
"input": "one,\ntwo,\nthree",
26+
"expected": { "one": 1, "two": 1, "three": 1 }
1727
},
1828
{
1929
"description": "ignore punctuation",
20-
"input": "car : carpet as java : javascript!!&@$%^&",
21-
"expected": { "car" : 1, "carpet" : 1, "as" : 1, "java" : 1, "javascript" : 1 }
30+
"input": "car: carpet as java: javascript!!&@$%^&",
31+
"expected": { "car": 1, "carpet": 1, "as": 1, "java": 1, "javascript": 1 }
2232
},
2333
{
2434
"description": "include numbers",
2535
"input": "testing, 1, 2 testing",
26-
"expected": { "testing" : 2, "1" : 1, "2" : 1 }
36+
"expected": { "testing": 2, "1": 1, "2": 1 }
2737
},
2838
{
2939
"description": "normalize case",
3040
"input": "go Go GO Stop stop",
31-
"expected": { "go" : 3, "stop" : 2 }
41+
"expected": { "go": 3, "stop": 2 }
42+
},
43+
{
44+
"description": "with apostrophes",
45+
"input": "First: don't laugh. Then: don't cry.",
46+
"expected": { "first": 1, "don't": 2, "laugh": 1, "then": 1, "cry": 1 }
47+
},
48+
{
49+
"description": "with_quotations",
50+
"input": "Joe can't tell between 'large' and large.",
51+
"expected": { "joe": 1, "can't": 1, "tell": 1, "between": 1, "large": 2, "and": 1 }
3252
}
3353
]
3454
}

0 commit comments

Comments
 (0)