// Written by retoor@molodetz.nl

// This source code is a simple testing routine for a string list implementation, verifying the addition, containment, and proper memory
// management functionality.

// The code uses custom imports: "rstring_list.h" and "rtest.h" for managing the string list and handling test scenarios respectively.

// MIT License: This code is free to use and distribute with attribution to the original author. No warranty is provided express or implied.

#include "rstring_list.h"
#include "rtest.h"

void test_rstring_list() {
    rtest_banner("new");
    rstring_list_t *rsl = rstring_list_new();
    rassert(rsl->count == 0);

    rtest_banner("add");
    rstring_list_add(rsl, "test1");
    rassert(rsl->count == 1);
    rstring_list_add(rsl, "test2");
    rassert(rsl->count == 2);

    rtest_banner("contains");
    rassert(rstring_list_contains(rsl, "test1"));
    rassert(rstring_list_contains(rsl, "test2"));
    rassert(!rstring_list_contains(rsl, "test3"));

    rtest_banner("free");
    rstring_list_free(rsl);
}

int main() {
    test_rstring_list();
    return rtest_end("");
}