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

Version Path
foundational_lib-1.0.1 ./tests/more/experimental/third_test_suite/non_production_ready_test_suite/test_every_relevant_function_in_a_separate_thorough_program/work_in_progress_code/src/test_count_occurrences_of_substr.c
foundational_lib2-1.0 ./tests/more/experimental/third_test_suite/non_production_ready_test_suite/test_every_relevant_function_in_a_separate_thorough_program/work_in_progress_code/src/test_count_occurrences_of_substr.c
foundational_lib-1.0 ./tests/more/experimental/third_test_suite/non_production_ready_test_suite/test_every_relevant_function_in_a_separate_thorough_program/work_in_progress_code/src/test_count_occurrences_of_substr.c