tc_task_has_tag

This commit is contained in:
Dustin J. Mitchell 2022-02-01 01:02:49 +00:00
parent 03ffb6ce83
commit f2b3e5fd0a
3 changed files with 39 additions and 4 deletions

View file

@ -149,9 +149,13 @@ static void task_task_add_tag(void) {
tc_task_to_mut(task, rep);
TEST_ASSERT_FALSE(tc_task_has_tag(task, tc_string_borrow("next")));
TEST_ASSERT_EQUAL(TC_RESULT_OK, tc_task_add_tag(task, tc_string_borrow("next")));
TEST_ASSERT_NULL(tc_task_error(task));
TEST_ASSERT_TRUE(tc_task_has_tag(task, tc_string_borrow("next")));
// invalid - synthetic tag
TEST_ASSERT_EQUAL(TC_RESULT_ERROR, tc_task_add_tag(task, tc_string_borrow("PENDING")));
TCString *err = tc_task_error(task);
@ -170,7 +174,7 @@ static void task_task_add_tag(void) {
TEST_ASSERT_NOT_NULL(err);
tc_string_free(err);
// TODO: test getting the tag
TEST_ASSERT_TRUE(tc_task_has_tag(task, tc_string_borrow("next")));
tc_task_free(task);
tc_replica_free(rep);