scm: add support for labels + tests

Add procedures 'label' (for a message) and all-labels (for a store).
This commit is contained in:
Dirk-Jan C. Binnema
2025-08-10 14:59:43 +03:00
parent 46fa4f2aa2
commit 910cec591f
5 changed files with 76 additions and 2 deletions

View File

@ -193,6 +193,20 @@ test_scm_script()
g_assert_true(res);
}
// add some label for testing
{
auto res = store->run_query("optimization");
const Labels::DeltaLabelVec labels{*Labels::parse_delta_label("+performance")};
assert_valid_result(res);
g_assert_cmpuint(res->size(), ==, 4);
for (auto& it: *res) {
auto msg{it.message()};
g_assert_true(!!msg);
const auto updateres{store->update_labels(*msg, labels)};
assert_valid_result(updateres);
}
}
Mu::Options opts{};
opts.scm.script_path = join_paths(MU_SCM_SRCDIR, "mu-scm-test.scm");