summaryrefslogtreecommitdiff
path: root/t/t0028-working-tree-encoding.sh
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-05-04 16:27:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-05 03:26:36 (GMT)
commit2fa3cbadcdc63c3a723c2fd490f1d84552854bee (patch)
tree877a4d690e319356a223f203b3eb283b4b519e6e /t/t0028-working-tree-encoding.sh
parent6a7bc9d11823239183dd5f6547b13824a6a15fc2 (diff)
downloadgit-2fa3cbadcdc63c3a723c2fd490f1d84552854bee.zip
git-2fa3cbadcdc63c3a723c2fd490f1d84552854bee.tar.gz
git-2fa3cbadcdc63c3a723c2fd490f1d84552854bee.tar.bz2
t0028: extract encoding helpers to lib-encoding.sh
The following patch will add tests outside t0028 which will also need to re-encode some strings. Extract the auxiliary encoding functions from t0028 to a common lib file so that they can be reused. Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0028-working-tree-encoding.sh')
-rwxr-xr-xt/t0028-working-tree-encoding.sh25
1 files changed, 1 insertions, 24 deletions
diff --git a/t/t0028-working-tree-encoding.sh b/t/t0028-working-tree-encoding.sh
index f970a98..82905a2 100755
--- a/t/t0028-working-tree-encoding.sh
+++ b/t/t0028-working-tree-encoding.sh
@@ -6,33 +6,10 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
. ./test-lib.sh
+. "$TEST_DIRECTORY/lib-encoding.sh"
GIT_TRACE_WORKING_TREE_ENCODING=1 && export GIT_TRACE_WORKING_TREE_ENCODING
-test_lazy_prereq NO_UTF16_BOM '
- test $(printf abc | iconv -f UTF-8 -t UTF-16 | wc -c) = 6
-'
-
-test_lazy_prereq NO_UTF32_BOM '
- test $(printf abc | iconv -f UTF-8 -t UTF-32 | wc -c) = 12
-'
-
-write_utf16 () {
- if test_have_prereq NO_UTF16_BOM
- then
- printf '\376\377'
- fi &&
- iconv -f UTF-8 -t UTF-16
-}
-
-write_utf32 () {
- if test_have_prereq NO_UTF32_BOM
- then
- printf '\0\0\376\377'
- fi &&
- iconv -f UTF-8 -t UTF-32
-}
-
test_expect_success 'setup test files' '
git config core.eol lf &&