Skip to content

Commit

Permalink
Fixed solution of conc-primes and word-count
Browse files Browse the repository at this point in the history
  • Loading branch information
rg0now committed Sep 2, 2024
1 parent 2a79a8e commit 74a8523
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions 20-goroutines/01-concurrent-primes/.exercise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ func TestGeneratePrimes(t *testing.T) {
input int
expected []int
}{
{"First 10 primes", 10, []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29}},
{"First 20 primes", 20, []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71}},
{"First 10 primes", 1000, []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31}},
{"First 20 primes", 5000, []int{2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67}},
{"Negative input", -1, []int{}},
{"Zero input", 0, []int{}},
}
Expand Down
2 changes: 1 addition & 1 deletion 20-goroutines/02-concurrent-word-count/.exercise_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func TestCountWords(t *testing.T) {
{"Single text", []string{"the quick brown fox jumps over the lazy dog"},
map[string]int{"the": 2, "quick": 1, "brown": 1, "fox": 1, "jumps": 1, "over": 1, "lazy": 1, "dog": 1}},
{"Multiple texts", []string{"hello world", "world hello", "hello hello"},
map[string]int{"hello": 3, "world": 2}},
map[string]int{"hello": 4, "world": 2}},
{"Empty input", []string{}, map[string]int{}},
}
for _, tc := range testCases {
Expand Down

0 comments on commit 74a8523

Please sign in to comment.