4
4
5
5
#[ test]
6
6
fn threaded_read_to_end ( ) {
7
- let ( mut writer, mut reader) = git_features:: io:: unidirectional ( 0 ) ;
7
+ let ( mut writer, mut reader) = git_features:: io:: pipe :: unidirectional ( 0 ) ;
8
8
9
9
let message = "Hello, world!" ;
10
10
std:: thread:: spawn ( move || {
@@ -21,15 +21,15 @@ mod io {
21
21
22
22
#[ test]
23
23
fn lack_of_reader_fails_with_broken_pipe ( ) {
24
- let ( mut writer, _) = io:: unidirectional ( None ) ;
24
+ let ( mut writer, _) = io:: pipe :: unidirectional ( None ) ;
25
25
assert_eq ! (
26
26
writer. write_all( b"must fail" ) . unwrap_err( ) . kind( ) ,
27
27
ErrorKind :: BrokenPipe
28
28
) ;
29
29
}
30
30
#[ test]
31
31
fn line_reading_one_by_one ( ) {
32
- let ( mut writer, mut reader) = io:: unidirectional ( 2 ) ;
32
+ let ( mut writer, mut reader) = io:: pipe :: unidirectional ( 2 ) ;
33
33
writer. write_all ( b"a\n " ) . expect ( "success" ) ;
34
34
writer. write_all ( b"b\n c" ) . expect ( "success" ) ;
35
35
drop ( writer) ;
@@ -43,7 +43,7 @@ mod io {
43
43
44
44
#[ test]
45
45
fn line_reading ( ) {
46
- let ( mut writer, reader) = io:: unidirectional ( 2 ) ;
46
+ let ( mut writer, reader) = io:: pipe :: unidirectional ( 2 ) ;
47
47
writer. write_all ( b"a\n " ) . expect ( "success" ) ;
48
48
writer. write_all ( b"b\n c\n " ) . expect ( "success" ) ;
49
49
drop ( writer) ;
@@ -55,7 +55,7 @@ mod io {
55
55
56
56
#[ test]
57
57
fn writer_can_inject_errors ( ) {
58
- let ( writer, mut reader) = io:: unidirectional ( 1 ) ;
58
+ let ( writer, mut reader) = io:: pipe :: unidirectional ( 1 ) ;
59
59
writer
60
60
. channel
61
61
. send ( Err ( std:: io:: Error :: new ( std:: io:: ErrorKind :: Other , "the error" ) ) )
@@ -80,7 +80,7 @@ mod io {
80
80
81
81
#[ test]
82
82
fn continue_on_empty_writes ( ) {
83
- let ( mut writer, mut reader) = io:: unidirectional ( 2 ) ;
83
+ let ( mut writer, mut reader) = io:: pipe :: unidirectional ( 2 ) ;
84
84
writer. write ( & [ ] ) . expect ( "write successful and non-blocking" ) ;
85
85
let input = b"hello" ;
86
86
writer
@@ -95,7 +95,7 @@ mod io {
95
95
fn small_reads ( ) {
96
96
const BLOCK_SIZE : usize = 20 ;
97
97
let block_count = 20 ;
98
- let ( mut writer, mut reader) = io:: unidirectional ( Some ( 4 ) ) ;
98
+ let ( mut writer, mut reader) = io:: pipe :: unidirectional ( Some ( 4 ) ) ;
99
99
std:: thread:: spawn ( move || {
100
100
for _ in 0 ..block_count {
101
101
let data = & [ 0 ; BLOCK_SIZE ] ;
0 commit comments