@@ -16,17 +16,18 @@ test("counts a single occurrence of a character", () => {
1616// When the function is called with these inputs,
1717// Then it should correctly count overlapping occurrences of char (e.g., 'a' appears five times in 'aaaaa').
1818test ( "counts multiple occurrences of a character" , ( ) => {
19- expect ( countChar ( "banana" , "a" ) ) . toEqual ( 3 ) ;
20- expect ( countChar ( "mississippi" , "s" ) ) . toEqual ( 4 ) ;
21- } ) ;
22-
23- test ( "should count multiple occurrences of a character" , ( ) => {
24- const str = "aaaaa" ;
25- const Char = "a" ;
26- const count = countChar ( str , Char ) ;
27- expect ( count ) . toEqual ( 5 ) ;
19+ expect ( countChar ( "aaaaa" , "a" ) ) . toEqual ( 5 ) ;
20+ expect ( countChar ( "banana" , "a" ) ) . toEqual ( 3 ) ;
21+ expect ( countChar ( "mississippi" , "s" ) ) . toEqual ( 4 ) ;
2822} ) ;
2923
24+ //test("should count multiple occurrences of a character", () => {
25+ // const str = "aaaaa";
26+ //const Char = "a";
27+ //const count = countChar(str,Char);
28+ // expect(count).toEqual(5);
29+ //});
30+
3031// Scenario: No Occurrences
3132// Given the input string str,
3233// And a character char that does not exist within the case-sensitive str,
0 commit comments