diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-02-03 08:39:28 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-02-03 08:39:28 -0800 |
commit | b273909b65f04481a14974eea69e078483adcad4 (patch) | |
tree | 3c768e756e3813a658ab0996f0eee38178b15a8d /tests | |
parent | 034286176f67c0b69c50dfead67ac96a75379e3f (diff) | |
download | ssh2-rs-b273909b65f04481a14974eea69e078483adcad4.zip |
Update to rust master
Diffstat (limited to 'tests')
-rw-r--r-- | tests/all.rs | 5 | ||||
-rw-r--r-- | tests/channel.rs | 10 | ||||
-rw-r--r-- | tests/session.rs | 4 | ||||
-rw-r--r-- | tests/sftp.rs | 2 |
4 files changed, 11 insertions, 10 deletions
diff --git a/tests/all.rs b/tests/all.rs index 448c6a6..66de542 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -1,8 +1,9 @@ +#![deny(warnings)] +#![feature(io, core, path, os, std_misc, libc)] + extern crate ssh2; extern crate libc; -use std::mem; -use std::num::Int; use std::os; use std::old_io::TcpStream; diff --git a/tests/channel.rs b/tests/channel.rs index 5879056..3150f40 100644 --- a/tests/channel.rs +++ b/tests/channel.rs @@ -29,7 +29,7 @@ fn writing_data() { let (_tcp, sess) = ::authed_session(); let mut channel = sess.channel_session().unwrap(); channel.exec("read foo && echo $foo").unwrap(); - channel.write(b"foo\n").unwrap(); + channel.write_all(b"foo\n").unwrap(); channel.close().unwrap(); let output = channel.read_to_string().unwrap(); assert_eq!(output.as_slice(), "foo\n"); @@ -72,12 +72,12 @@ fn direct() { let b = &mut [0, 0, 0]; s.read(b).unwrap(); assert_eq!(b.as_slice(), [1, 2, 3].as_slice()); - s.write(&[4, 5, 6]).unwrap(); + s.write_all(&[4, 5, 6]).unwrap(); }); let (_tcp, sess) = ::authed_session(); let mut channel = sess.channel_direct_tcpip("127.0.0.1", addr.port, None).unwrap(); - channel.write(&[1, 2, 3]).unwrap(); + channel.write_all(&[1, 2, 3]).unwrap(); let r = &mut [0, 0, 0]; channel.read(r).unwrap(); assert_eq!(r.as_slice(), [4, 5, 6].as_slice()); @@ -94,11 +94,11 @@ fn forward() { let b = &mut [0, 0, 0]; s.read(b).unwrap(); assert_eq!(b.as_slice(), [1, 2, 3].as_slice()); - s.write(&[4, 5, 6]).unwrap(); + s.write_all(&[4, 5, 6]).unwrap(); }); let mut channel = listen.accept().unwrap(); - channel.write(&[1, 2, 3]).unwrap(); + channel.write_all(&[1, 2, 3]).unwrap(); let r = &mut [0, 0, 0]; channel.read(r).unwrap(); assert_eq!(r.as_slice(), [4, 5, 6].as_slice()); diff --git a/tests/session.rs b/tests/session.rs index 41eb5e0..5814e55 100644 --- a/tests/session.rs +++ b/tests/session.rs @@ -1,7 +1,7 @@ use std::os; use std::old_io::{self, File, TempDir}; -use ssh2::{self, Session, MethodType, HashType}; +use ssh2::{Session, MethodType, HashType}; #[test] fn smoke() { @@ -66,7 +66,7 @@ fn scp_send() { let (_tcp, sess) = ::authed_session(); let mut ch = sess.scp_send(&td.path().join("foo"), old_io::USER_FILE, 6, None).unwrap(); - ch.write(b"foobar").unwrap(); + ch.write_all(b"foobar").unwrap(); drop(ch); let actual = File::open(&td.path().join("foo")).read_to_end().unwrap(); assert_eq!(actual.as_slice(), b"foobar"); diff --git a/tests/sftp.rs b/tests/sftp.rs index f7da4c8..d3b8042 100644 --- a/tests/sftp.rs +++ b/tests/sftp.rs @@ -21,7 +21,7 @@ fn ops() { assert!(td.path().join("bar2").is_dir()); sftp.rmdir(&td.path().join("bar2")).unwrap(); - sftp.create(&td.path().join("foo5")).unwrap().write(b"foo").unwrap(); + sftp.create(&td.path().join("foo5")).unwrap().write_all(b"foo").unwrap(); assert_eq!(File::open(&td.path().join("foo5")).read_to_end().unwrap(), b"foo".to_vec()); |