Skip to content

Commit 98b4ec0

Browse files
committed
Merge pull request #103 from hankturowski/master
Added core set of test cases for word-count
2 parents 867a0be + 64305b4 commit 98b4ec0

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

word-count.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"cases": [
3+
{
4+
"description": "count one word",
5+
"input": "word",
6+
"expected": {"word": 1}
7+
},
8+
{
9+
"description": "count one of each word",
10+
"input": "one of each",
11+
"expected": { "one": 1, "of": 1, "each": 1 }
12+
},
13+
{
14+
"description": "multiple occurrences of a word",
15+
"input": "one fish two fish red fish blue fish",
16+
"expected": { "one" : 1, "fish" : 4, "two" : 1, "red" : 1, "blue" : 1 }
17+
},
18+
{
19+
"description": "ignore punctuation",
20+
"input": "car : carpet as java : javascript!!&@$%^&",
21+
"expected": { "car" : 1, "carpet" : 1, "as" : 1, "java" : 1, "javascript" : 1 }
22+
},
23+
{
24+
"description": "include numbers",
25+
"input": "testing, 1, 2 testing",
26+
"expected": { "testing" : 2, "1" : 1, "2" : 1 }
27+
},
28+
{
29+
"description": "normalize case",
30+
"input": "go Go GO",
31+
"expected": { "go" : 3 }
32+
}
33+
]
34+
}

0 commit comments

Comments
 (0)