Skip to content

Commit 23f5712

Browse files
committed
Updated
1 parent 7b24b31 commit 23f5712

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Subproject commit 3372770a4d6ae71b931968a6d6deb70dda58a065

Sprint-3/2-practice-tdd/count.test.js

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,21 @@ test("should return 0 if the character does not exist in the string", () => {
2929
const count = countChar(str, char);
3030
expect(count).toEqual(0);
3131
});
32-
33-
test("should return 0 if the character does not exist in the string", () => {
34-
const str = "hello";
35-
const char = "z";
36-
const count = countChar(str, char);
37-
expect(count).toEqual(0);
32+
test("should be case-sensitive", () => {
33+
const str = "Hello";
34+
const char = "h";
35+
const result = countChar(str, char);
36+
expect(result).toBe(0);
3837
});
38+
test("should count non-alphabet characters", () => {
39+
const str = "hello!!!";
40+
const char = "!";
41+
const result = countChar(str, char);
42+
expect(result).toBe(3);
43+
});
44+
test("should count multiple occurrences correctly", () => {
45+
const str = "banana";
46+
const char = "a";
47+
const result = countChar(str, char);
48+
expect(result).toBe(3);
49+
});

Sprint-3/2-practice-tdd/get-ordinal-number.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test("should append 'rd' for numbers ending with 3, except those ending with 13"
4040
// Case 4: Numbers ending with 11, 12, 13, or any other digit
4141
// When the number ends with 11, 12, 13, or any digit not 1, 2, or 3,
4242
// Then the function should return a string by appending "th" to the number.
43-
test("should append 'th' for numbers ending with 11, 12, 13, or other digits", () => {
43+
test("should append 'th' for numbers ending with 11, 12, or 13", () => {
4444
expect(getOrdinalNumber(11)).toEqual("11th");
4545
expect(getOrdinalNumber(12)).toEqual("12th");
4646
expect(getOrdinalNumber(13)).toEqual("13th");

0 commit comments

Comments
 (0)