Sha256: 4d33b890572f48cd8e9b02e7ecb76b82550c2e2855440dc6ec24210ec629f780

Contents?: true

Size: 747 Bytes

Versions: 3

Compression:

Stored size: 747 Bytes

Contents

#include "../foundationallib.h"
#include <assert.h>

int main()
{
    // Test cases
    assert(common_prefix_length("abcdef", "abcde") == 5);
    assert(common_prefix_length("abc", "abcde") == 3);
    assert(common_prefix_length("abcdef", "xyz") == 0);
    assert(common_prefix_length("abc", "abcdef") == 3);
    assert(common_prefix_length("", "") == 0);
    assert(common_prefix_length("abc", "abc") == 3);
    assert(common_prefix_length("a", "b") == 0);
    assert(common_prefix_length("abc", "") == 0);

    // Additional corner cases
    assert(common_prefix_length(NULL, "abc") == 0);
    assert(common_prefix_length("abc", NULL) == 0);
    assert(common_prefix_length(NULL, NULL) == 0);

    printf("All tests passed!\n");
    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_common_prefix_length.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_common_prefix_length.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_common_prefix_length.c