Skip to content

Commit 3689ec2

Browse files
committed
✅ Update test naming
1 parent 64b3f46 commit 3689ec2

File tree

4 files changed

+19
-7
lines changed

4 files changed

+19
-7
lines changed

bean_counting.test.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
import {
2-
counChar,
32
countBs,
3+
countChar,
44
counterOcurrencesCreator,
55
} from "./bean_counting.ts";
66
import { assert } from "./testing.ts";
77

8-
Deno.test("Main", () => {
8+
Deno.test("[countBs]", () => {
9+
assert(countBs("BBBaB") === 4);
10+
assert(countBs("111aaa") === 0);
11+
});
12+
13+
Deno.test("[countChar]", () => {
14+
assert(countChar("BBBa", "B") === 3);
15+
});
16+
17+
Deno.test("[counterOcurrencesCreator]", () => {
18+
const countEs = counterOcurrencesCreator("E");
19+
20+
assert(countEs("EEEEaaa33") == 4);
921
});

bean_counting.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
export function counChar(text: string, charToSearch: string) {
1+
export function countChar(text: string, charToSearch: string) {
22
const occurences = [...text].filter((letter) => letter === charToSearch);
33
return occurences.length;
44
}
55

66
export function counterOcurrencesCreator(charToSearch: string) {
7-
return (text: string) => counChar(text, charToSearch);
7+
return (text: string) => countChar(text, charToSearch);
88
}
99

1010
export const countBs = counterOcurrencesCreator("B");

is_even.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { isEven } from "./is_even.ts";
22
import { assert } from "./testing.ts";
33

4-
Deno.test("Main", () => {
4+
Deno.test("[isEven]", () => {
55
assert(isEven(2));
66
assert(!isEven(11));
77
assert(isEven(24));

minimum.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { min, minRecursive } from "./minimum.ts";
22

33
import { assert } from "./testing.ts";
44

5-
Deno.test("main", () => {
5+
Deno.test("[min]", () => {
66
assert(min(5, 3, 4, 2, 22) === 2);
77

88
assert(min(5, 3, 4, 2, 22, -3) === -3);
99
assert(min(-23, 5, 3, 4, 2, 22, -3) === -23);
1010
});
1111

12-
Deno.test("recursive", () => {
12+
Deno.test("[minRecursive]", () => {
1313
assert(minRecursive(5, 3, 4, 2, 22) === 2);
1414

1515
assert(minRecursive(5, 3, 4, 2, 22, -3) === -3);

0 commit comments

Comments
 (0)