]> git.ipfire.org Git - thirdparty/git.git/commit
t/unit-tests: adapt example decorate test to use clar test framework
authorSeyi Kuforiji <kuforiji98@gmail.com>
Fri, 31 Jan 2025 22:14:18 +0000 (23:14 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Jan 2025 22:58:44 +0000 (14:58 -0800)
commite0f807bdad096ef6a4d9f29de333d65d8282aeb1
treef329d6723a13bc796e709233a3efb8b5d9bdb3ac
parent38b066ee7685d0074d3430284f975addda934c17
t/unit-tests: adapt example decorate test to use clar test framework

Introduce `test_example_decorate__initialize()` to explicitly set up
object IDs and retrieve corresponding objects before tests run. This
ensures a consistent and predictable test state without relying on data
from previous tests.

Add `test_example_decorate__cleanup()` to clear decorations after each
test, preventing interference between tests and ensuring each runs in
isolation.

Adapt example decorate test script to clar framework by using clar
assertions where necessary. Previously, tests relied on data written by
earlier tests, leading to unintended dependencies between them. This
explicitly initializes the necessary state within
`test_example_decorate__readd`, ensuring it does not depend on prior
test executions.

Mentored-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Seyi Kuforiji <kuforiji98@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
t/meson.build
t/unit-tests/t-example-decorate.c [deleted file]
t/unit-tests/u-example-decorate.c [new file with mode: 0644]