Skip to content

Commit

Permalink
test: consolidate definition of $LF
Browse files Browse the repository at this point in the history
As we seem to need this variable that holds a single LF character
in many places, define it in test-lib.sh and let the test scripts
use it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Aug 11, 2011
1 parent 7f684a2 commit 3f4ab62
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9 deletions.
2 changes: 0 additions & 2 deletions t/t1013-loose-object-format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ standard format, deflated with 4KB window size: Agit/JGit on Android
'

. ./test-lib.sh
LF='
'

assert_blob_equals() {
printf "%s" "$2" >expected &&
Expand Down
2 changes: 0 additions & 2 deletions t/t1020-subdirectory.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ test_expect_success setup '
cp one original.one &&
cp dir/two original.two
'
LF='
'

test_expect_success 'update-index and ls-files' '
git update-index --add one &&
Expand Down
2 changes: 0 additions & 2 deletions t/t3902-quoted.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ test_description='quoted output'
FN='濱野'
GN=''
HT=' '
LF='
'
DQ='"'

echo foo 2>/dev/null > "Name and an${HT}HT"
Expand Down
3 changes: 0 additions & 3 deletions t/t7800-difftool.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ Testing basic diff tool invocation

. ./test-lib.sh

LF='
'

remove_config_vars()
{
# Unset all config variables used by git-difftool
Expand Down
4 changes: 4 additions & 0 deletions t/test-lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ _x40="$_x05$_x05$_x05$_x05$_x05$_x05$_x05$_x05"
# Zero SHA-1
_z40=0000000000000000000000000000000000000000

# Line feed
LF='
'

# Each test should start with something like this, after copyright notices:
#
# test_description='Description of this test...
Expand Down

0 comments on commit 3f4ab62

Please sign in to comment.