Skip to content

Commit 9604154

Browse files
committed
fix io::pipe tests
1 parent ccbaa25 commit 9604154

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

git-features/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ required-features = ["parallel"]
2626
[[test]]
2727
name = "pipe"
2828
path = "tests/pipe.rs"
29-
required-features = ["pipe"]
29+
required-features = ["io-pipe"]
3030

3131
[dependencies]
3232
git-object = { version = "^0.4.0", path = "../git-object", optional = true }

git-features/tests/pipe.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod io {
44

55
#[test]
66
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);
88

99
let message = "Hello, world!";
1010
std::thread::spawn(move || {
@@ -21,15 +21,15 @@ mod io {
2121

2222
#[test]
2323
fn lack_of_reader_fails_with_broken_pipe() {
24-
let (mut writer, _) = io::unidirectional(None);
24+
let (mut writer, _) = io::pipe::unidirectional(None);
2525
assert_eq!(
2626
writer.write_all(b"must fail").unwrap_err().kind(),
2727
ErrorKind::BrokenPipe
2828
);
2929
}
3030
#[test]
3131
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);
3333
writer.write_all(b"a\n").expect("success");
3434
writer.write_all(b"b\nc").expect("success");
3535
drop(writer);
@@ -43,7 +43,7 @@ mod io {
4343

4444
#[test]
4545
fn line_reading() {
46-
let (mut writer, reader) = io::unidirectional(2);
46+
let (mut writer, reader) = io::pipe::unidirectional(2);
4747
writer.write_all(b"a\n").expect("success");
4848
writer.write_all(b"b\nc\n").expect("success");
4949
drop(writer);
@@ -55,7 +55,7 @@ mod io {
5555

5656
#[test]
5757
fn writer_can_inject_errors() {
58-
let (writer, mut reader) = io::unidirectional(1);
58+
let (writer, mut reader) = io::pipe::unidirectional(1);
5959
writer
6060
.channel
6161
.send(Err(std::io::Error::new(std::io::ErrorKind::Other, "the error")))
@@ -80,7 +80,7 @@ mod io {
8080

8181
#[test]
8282
fn continue_on_empty_writes() {
83-
let (mut writer, mut reader) = io::unidirectional(2);
83+
let (mut writer, mut reader) = io::pipe::unidirectional(2);
8484
writer.write(&[]).expect("write successful and non-blocking");
8585
let input = b"hello";
8686
writer
@@ -95,7 +95,7 @@ mod io {
9595
fn small_reads() {
9696
const BLOCK_SIZE: usize = 20;
9797
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));
9999
std::thread::spawn(move || {
100100
for _ in 0..block_count {
101101
let data = &[0; BLOCK_SIZE];

0 commit comments

Comments
 (0)