Browse Source

Merge branch 'wc/make-funnynames-shared-lazy-prereq'

A test prerequisite defined by various test scripts with slightly
different semantics has been consolidated into a single copy and
made into a lazily defined one.

* wc/make-funnynames-shared-lazy-prereq:
  t: factor out FUNNYNAMES as shared lazy prereq
maint
Junio C Hamano 7 years ago
parent
commit
e72db08f15
  1. 8
      t/t3600-rm.sh
  2. 10
      t/t4135-apply-weird-filenames.sh
  3. 6
      t/t9902-completion.sh
  4. 13
      t/t9903-bash-prompt.sh
  5. 14
      t/test-lib.sh

8
t/t3600-rm.sh

@ -14,15 +14,13 @@ test_expect_success \ @@ -14,15 +14,13 @@ test_expect_success \
git add -- foo bar baz 'space embedded' -q &&
git commit -m 'add normal files'"

if test_have_prereq !MINGW && touch -- 'tab embedded' 'newline
embedded' 2>/dev/null
then
test_set_prereq FUNNYNAMES
else
if test_have_prereq !FUNNYNAMES; then
say 'Your filesystem does not allow tabs in filenames.'
fi

test_expect_success FUNNYNAMES 'add files with funny names' "
touch -- 'tab embedded' 'newline
embedded' &&
git add -- 'tab embedded' 'newline
embedded' &&
git commit -m 'add files with tabs and newlines'

10
t/t4135-apply-weird-filenames.sh

@ -15,15 +15,7 @@ test_expect_success 'setup' ' @@ -15,15 +15,7 @@ test_expect_success 'setup' '
git checkout -f preimage^0 &&
git read-tree -u --reset HEAD &&
git update-index --refresh
} &&

test_when_finished "rm -f \"tab embedded.txt\"" &&
test_when_finished "rm -f '\''\"quoteembedded\".txt'\''" &&
if test_have_prereq !MINGW &&
touch -- "tab embedded.txt" '\''"quoteembedded".txt'\''
then
test_set_prereq FUNNYNAMES
fi
}
'

try_filename() {

6
t/t9902-completion.sh

@ -1278,7 +1278,7 @@ test_expect_success 'setup for path completion tests' ' @@ -1278,7 +1278,7 @@ test_expect_success 'setup for path completion tests' '
touch BS\\dir/DQ\"file \
'$'separators\034in\035dir/sep\036in\037file''
then
test_set_prereq FUNNYNAMES
test_set_prereq FUNNIERNAMES
else
rm -rf BS\\dir '$'separators\034in\035dir''
fi
@ -1320,7 +1320,7 @@ test_expect_success '__git_complete_index_file - UTF-8 in ls-files output' ' @@ -1320,7 +1320,7 @@ test_expect_success '__git_complete_index_file - UTF-8 in ls-files output' '
test_path_completion árvíztűrő/С "árvíztűrő/Сайн яваарай"
'

test_expect_success FUNNYNAMES \
test_expect_success FUNNIERNAMES \
'__git_complete_index_file - C-style escapes in ls-files output' '
test_path_completion BS \
BS\\dir &&
@ -1332,7 +1332,7 @@ test_expect_success FUNNYNAMES \ @@ -1332,7 +1332,7 @@ test_expect_success FUNNYNAMES \
BS\\dir/DQ\"file
'

test_expect_success FUNNYNAMES \
test_expect_success FUNNIERNAMES \
'__git_complete_index_file - \nnn-escaped characters in ls-files output' '
test_path_completion sep '$'separators\034in\035dir'' &&
test_path_completion '$'separators\034i'' \

13
t/t9903-bash-prompt.sh

@ -63,18 +63,15 @@ test_expect_success 'prompt - unborn branch' ' @@ -63,18 +63,15 @@ test_expect_success 'prompt - unborn branch' '
test_cmp expected "$actual"
'

repo_with_newline='repo
with
newline'

if test_have_prereq !MINGW && mkdir "$repo_with_newline" 2>/dev/null
then
test_set_prereq FUNNYNAMES
else
if test_have_prereq !FUNNYNAMES; then
say 'Your filesystem does not allow newlines in filenames.'
fi

test_expect_success FUNNYNAMES 'prompt - with newline in path' '
repo_with_newline="repo
with
newline" &&
mkdir "$repo_with_newline" &&
printf " (master)" >expected &&
git init "$repo_with_newline" &&
test_when_finished "rm -rf \"$repo_with_newline\"" &&

14
t/test-lib.sh

@ -1104,6 +1104,20 @@ test_lazy_prereq CASE_INSENSITIVE_FS ' @@ -1104,6 +1104,20 @@ test_lazy_prereq CASE_INSENSITIVE_FS '
test "$(cat CamelCase)" != good
'

test_lazy_prereq FUNNYNAMES '
test_have_prereq !MINGW &&
touch -- \
"FUNNYNAMES tab embedded" \
"FUNNYNAMES \"quote embedded\"" \
"FUNNYNAMES newline
embedded" 2>/dev/null &&
rm -- \
"FUNNYNAMES tab embedded" \
"FUNNYNAMES \"quote embedded\"" \
"FUNNYNAMES newline
embedded" 2>/dev/null
'

test_lazy_prereq UTF8_NFD_TO_NFC '
# check whether FS converts nfd unicode to nfc
auml=$(printf "\303\244")

Loading…
Cancel
Save