Re: [PATCH v1] Git config cache & special querying api utilizing the cache
From: Matthieu Moy <hidden>
Date: 2016-06-15 23:01:35
Tanay Abhra [off-list ref] writes:
I have run the tests and debug the code using custom functions and it works fine.
I understand that you wrote the custom functions for you, but didn't include them in the patch, right? If so, wouldn't it make sense to include these as unit-tests for your code? See what Git already does with test-*.c, e.g. $ git grep test-hashmap .gitignore:/test-hashmap Documentation/technical/api-hashmap.txt:See test-hashmap.c for an example using arbitrary-length strings as keys. Makefile:TEST_PROGRAMS_NEED_X += test-hashmap t/t0011-hashmap.sh: echo "$1" | test-hashmap $3 > actual && t/t0011-hashmap.sh: cat in | test-hashmap > out && test-hashmap.c: * Usage: time echo "perfhashmap method rounds" | test-hashmap for examples. The resulting binary would be a good candidate for valgrind --leak-check=full. The tests are not just for you, they are also: * For reviewers, to show an example of correct usage of the new API, * For people of the future, to avoid regressions. -- Matthieu Moy http://www-verimag.imag.fr/~moy/