@@ -53,7 +53,7 @@ long_read_test () {
5353 } > input &
5454 } &&
5555 test-line-buffer input << -EOF >output &&
56- read $readsize
56+ binary $readsize
5757 copy $copysize
5858 EOF
5959 kill $! &&
@@ -71,41 +71,41 @@ test_expect_success 'setup: have pipes?' '
7171'
7272
7373test_expect_success ' hello world' '
74- echo HELLO >expect &&
74+ echo "> HELLO" >expect &&
7575 test-line-buffer <<-\EOF >actual &&
76- read 6
76+ binary 6
7777 HELLO
7878 EOF
7979 test_cmp expect actual
8080'
8181
8282test_expect_success PIPE ' 0-length read, no input available' '
83- >expect &&
83+ printf ">" >expect &&
8484 rm -f input &&
8585 mkfifo input &&
8686 {
8787 sleep 100 >input &
8888 } &&
8989 test-line-buffer input <<-\EOF >actual &&
90- read 0
90+ binary 0
9191 copy 0
9292 EOF
9393 kill $! &&
9494 test_cmp expect actual
9595'
9696
9797test_expect_success ' 0-length read, send along greeting' '
98- echo HELLO >expect &&
98+ echo "> HELLO" >expect &&
9999 test-line-buffer <<-\EOF >actual &&
100- read 0
100+ binary 0
101101 copy 6
102102 HELLO
103103 EOF
104104 test_cmp expect actual
105105'
106106
107107test_expect_success PIPE ' 1-byte read, no input available' '
108- printf "%s" ab >expect &&
108+ printf "> %s" ab >expect &&
109109 rm -f input &&
110110 mkfifo input &&
111111 {
@@ -116,7 +116,7 @@ test_expect_success PIPE '1-byte read, no input available' '
116116 } >input &
117117 } &&
118118 test-line-buffer input <<-\EOF >actual &&
119- read 1
119+ binary 1
120120 copy 1
121121 EOF
122122 kill $! &&
@@ -140,15 +140,6 @@ test_expect_success 'read from file descriptor' '
140140 test_cmp expect actual
141141'
142142
143- test_expect_success ' buffer_read_string copes with null byte' '
144- >expect &&
145- q_to_nul <<-\EOF | test-line-buffer >actual &&
146- read 2
147- Q
148- EOF
149- test_cmp expect actual
150- '
151-
152143test_expect_success ' skip, copy null byte' '
153144 echo Q | q_to_nul >expect &&
154145 q_to_nul <<-\EOF | test-line-buffer >actual &&
@@ -170,18 +161,18 @@ test_expect_success 'read null byte' '
170161'
171162
172163test_expect_success ' long reads are truncated' '
173- echo foo >expect &&
164+ echo "> foo" >expect &&
174165 test-line-buffer <<-\EOF >actual &&
175- read 5
166+ binary 5
176167 foo
177168 EOF
178169 test_cmp expect actual
179170'
180171
181172test_expect_success ' long copies are truncated' '
182- printf "%s\n" "" foo >expect &&
173+ printf "%s\n" "> " foo >expect &&
183174 test-line-buffer <<-\EOF >actual &&
184- read 1
175+ binary 1
185176
186177 copy 5
187178 foo
0 commit comments