21 lines
460 B
C
21 lines
460 B
C
#include <criterion/criterion.h>
|
|
|
|
#include "utils.h"
|
|
|
|
/*
|
|
** TESTS: string/starts_with.c
|
|
*/
|
|
|
|
Test(utils_string, starts_with_true)
|
|
{
|
|
cr_assert_eq(starts_with("```c", "```"), 1);
|
|
cr_assert_eq(starts_with("hello world", "hello"), 1);
|
|
cr_assert_eq(starts_with("abc", "abc"), 1);
|
|
}
|
|
|
|
Test(utils_string, starts_with_false)
|
|
{
|
|
cr_assert_eq(starts_with("hello", "world"), 0);
|
|
cr_assert_eq(starts_with("abc", "abcd"), 0);
|
|
cr_assert_eq(starts_with("", "test"), 0);
|
|
}
|