Sha256: a7d09a9239661f324a1c55992bf0ff02ecca5190910e53b9f0409dd5d57cb062
Contents?: true
Size: 832 Bytes
Versions: 3
Compression:
Stored size: 832 Bytes
Contents
#include "../foundationallib.h" #include <assert.h> int main() { // Test cases and assertions for count_occurrences_of_subst assert(count_occurrences_of_substr("hellohellohello", "hello") == 3); assert(count_occurrences_of_substr("abcabcabc", "abc") == 3); assert(count_occurrences_of_substr("aaaaaaa", "aaa") == 4); assert(count_occurrences_of_substr("not found", "abc") == 0); assert(count_occurrences_of_substr("Case sensitive", "case") == 0); assert(count_occurrences_of_substr("Case sensitive", "Case") == 1); // Additional edge cases assert(count_occurrences_of_substr("aaaaa", "aa") == 4); assert(count_occurrences_of_substr("ababababa", "aba") == 3); assert(count_occurrences_of_substr("", "abc") == 0); assert(count_occurrences_of_substr("abc", "") == 0); return 0; }
Version data entries
3 entries across 3 versions & 2 rubygems