summaryrefslogtreecommitdiff
path: root/t/t0081-line-buffer.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-03-26 11:35:41 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-03-26 11:35:41 -0700
commita080fdd1b15612f71e5cc660c108f7d6c03804dd (patch)
treea798d46c93c1df8d9197537a236f85f5be57c09f /t/t0081-line-buffer.sh
parentMerge git-gui 0.14.0 (diff)
parentvcs-svn: handle log message with embedded NUL (diff)
downloadtgif-a080fdd1b15612f71e5cc660c108f7d6c03804dd.tar.xz
Merge branch 'svn-fe' of git://repo.or.cz/git/jrn
* 'svn-fe' of git://repo.or.cz/git/jrn: vcs-svn: handle log message with embedded NUL vcs-svn: avoid unnecessary copying of log message and author vcs-svn: remove buffer_read_string vcs-svn: make reading of properties binary-safe
Diffstat (limited to 't/t0081-line-buffer.sh')
-rwxr-xr-xt/t0081-line-buffer.sh35
1 files changed, 13 insertions, 22 deletions
diff --git a/t/t0081-line-buffer.sh b/t/t0081-line-buffer.sh
index 550fad0823..1dbe1c9b08 100755
--- a/t/t0081-line-buffer.sh
+++ b/t/t0081-line-buffer.sh
@@ -53,7 +53,7 @@ long_read_test () {
} >input &
} &&
test-line-buffer input <<-EOF >output &&
- read $readsize
+ binary $readsize
copy $copysize
EOF
kill $! &&
@@ -71,23 +71,23 @@ test_expect_success 'setup: have pipes?' '
'
test_expect_success 'hello world' '
- echo HELLO >expect &&
+ echo ">HELLO" >expect &&
test-line-buffer <<-\EOF >actual &&
- read 6
+ binary 6
HELLO
EOF
test_cmp expect actual
'
test_expect_success PIPE '0-length read, no input available' '
- >expect &&
+ printf ">" >expect &&
rm -f input &&
mkfifo input &&
{
sleep 100 >input &
} &&
test-line-buffer input <<-\EOF >actual &&
- read 0
+ binary 0
copy 0
EOF
kill $! &&
@@ -95,9 +95,9 @@ test_expect_success PIPE '0-length read, no input available' '
'
test_expect_success '0-length read, send along greeting' '
- echo HELLO >expect &&
+ echo ">HELLO" >expect &&
test-line-buffer <<-\EOF >actual &&
- read 0
+ binary 0
copy 6
HELLO
EOF
@@ -105,7 +105,7 @@ test_expect_success '0-length read, send along greeting' '
'
test_expect_success PIPE '1-byte read, no input available' '
- printf "%s" ab >expect &&
+ printf ">%s" ab >expect &&
rm -f input &&
mkfifo input &&
{
@@ -116,7 +116,7 @@ test_expect_success PIPE '1-byte read, no input available' '
} >input &
} &&
test-line-buffer input <<-\EOF >actual &&
- read 1
+ binary 1
copy 1
EOF
kill $! &&
@@ -140,15 +140,6 @@ test_expect_success 'read from file descriptor' '
test_cmp expect actual
'
-test_expect_success 'buffer_read_string copes with null byte' '
- >expect &&
- q_to_nul <<-\EOF | test-line-buffer >actual &&
- read 2
- Q
- EOF
- test_cmp expect actual
-'
-
test_expect_success 'skip, copy null byte' '
echo Q | q_to_nul >expect &&
q_to_nul <<-\EOF | test-line-buffer >actual &&
@@ -170,18 +161,18 @@ test_expect_success 'read null byte' '
'
test_expect_success 'long reads are truncated' '
- echo foo >expect &&
+ echo ">foo" >expect &&
test-line-buffer <<-\EOF >actual &&
- read 5
+ binary 5
foo
EOF
test_cmp expect actual
'
test_expect_success 'long copies are truncated' '
- printf "%s\n" "" foo >expect &&
+ printf "%s\n" ">" foo >expect &&
test-line-buffer <<-\EOF >actual &&
- read 1
+ binary 1
copy 5
foo