Re: [PATCH v6 26/27] t1406: new tests for submodule ref store
From: Duy Nguyen <hidden>
Date: 2017-03-20 12:08:17
On Mon, Mar 20, 2017 at 12:27 PM, Michael Haggerty [off-list ref] wrote:
On 03/18/2017 03:03 AM, Nguyễn Thái Ngọc Duy wrote:quoted
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted> --- t/t1406-submodule-ref-store.sh (new +x) | 95 +++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100755 t/t1406-submodule-ref-store.shdiff --git a/t/t1406-submodule-ref-store.sh b/t/t1406-submodule-ref-store.sh new file mode 100755 index 0000000000..22214ebd32 --- /dev/null +++ b/t/t1406-submodule-ref-store.sh@@ -0,0 +1,95 @@ +#!/bin/sh + +test_description='test submodule ref store api' + +. ./test-lib.sh + +RUN="test-ref-store submodule:sub" + +test_expect_success 'setup' ' + git init sub && + ( + cd sub && + test_commit first && + git checkout -b new-master + ) +' + +test_expect_success 'pack_refs() not allowed' ' + test_must_fail $RUN pack-refs 3 +'It's a little bit unfortunate but probably OK that this test and its analog in t1405 hard-code internal numerical constants. At least in t1405 the names of the constants appear in the test name, meaning that anybody changing the constants' values in the future will probably find the "3" in that file.
I noticed that too, but was not motivated enough to do actual enum/define <-> string mapping in test-ref-store.
Would you do the same here, please, or at least mention the constant names in a comment here?
Will do (and hopefully will make test-ref-store take names instead of numbers at a later point, or you'll get annoyed faster and do it ;-) -- Duy