t0200: use path checking helpers
PATCH 1/1 t0200: use path checking helpers
Replace direct directory and file checks with the corresponding test helpers in t/t0200-gettext-basic.sh.
Instances were located using:
git grep -n -E 'test -[efds]' -- 't/t[0-9]*.sh'
--- t/t0200-gettext-basic.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
t/t0200-gettext-basic.sh +2 -2
@@ -31,12 +31,12 @@ test_expect_success 'xgettext sanity: Comment extraction with --add-comments sto ' test_expect_success GETTEXT 'sanity: $TEXTDOMAINDIR exists without NO_GETTEXT=YesPlease' ' - test -d "$TEXTDOMAINDIR" && + test_path_is_dir "$TEXTDOMAINDIR" && test "$TEXTDOMAINDIR" = "$GIT_TEXTDOMAINDIR" ' test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' ' - test -f "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo" + test_path_is_file "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo" ' # TODO: When we have more locales, generalize this to test them
Signature · 1 line
2.55.0
Quoted 3 lines
Replace direct directory and file checks with the corresponding test helpers in
t/t0200-gettext-basic.sh.
This is a little bit more confusing. The commit message does not really show why you did what you did. Along the line of
"Modernize the code testing whether a file exists in "filename"' seems better. Also, your patches is doing two things, i.e modernizing the 'test -f' and 'test -d'. Ideally a patch should only focus on one thing but, since this is
simple patch. It is okay.
Quoted 3 lines
Instances were located using:
git grep -n -E 'test -[efds]' -- 't/t[0-9]*.sh'
This part is nto necessary.
Quoted 14 lines
Signed-off-by Victor Okafor <[email protected]>--- t/t0200-gettext-basic.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)t/t0200-gettext-basic.sh +1
-2test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' ' - test -f "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo" + test_path_is_file "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo" ' # TODO: When we have more locales, generalize this to test them --
Quoted 2 lines
2.55.0
Thanks
Quoted 1 line
Quoted 12 lines · Usman Akinyemi
Quoted 3 lines
Replace direct directory and file checks with the corresponding test helpers in
t/t0200-gettext-basic.sh.This is a little bit more confusing. The commit message does not really show why you did what you did. Along the line of
"Modernize the code testing whether a file exists in "filename"' seems better. Also, your patches is doing two things, i.e modernizing the 'test -f' and 'test -d'. Ideally a patch should only focus on one thing but, since this is
simple patch. It is okay.Quoted 1 line
Quoted 3 lines
Quoted 2 lines
Instances were located using:
git grep -n -E 'test -[efds]' -- 't/t[0-9]*.sh'This part is nto necessary.
Since many candidates are working on similar microprojects (which is fine) and making the same mistakes (which is expected), perhaps mentors should tell them to read the review exchanges on other candidates' patches and learn from them.
Quoted 18 lines
Quoted 14 lines
Signed-off-by Victor Okafor <[email protected]>--- t/t0200-gettext-basic.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)t/t0200-gettext-basic.sh +1
-2test_expect_success GETTEXT 'sanity: Icelandic locale was compiled' ' - test -f "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo" + test_path_is_file "$TEXTDOMAINDIR/is/LC_MESSAGES/git.mo" ' # TODO: When we have more locales, generalize this to test them --Quoted 2 lines
2.55.0
Thanks
Quoted 1 line