Skip to content

Commit

Permalink
fix(common): MultiPartReader test case
Browse files Browse the repository at this point in the history
Simple fixes, required as its API changed
  • Loading branch information
Byron committed Mar 18, 2015
1 parent 224af64 commit 6b23013
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/rust/cmn.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::marker::MarkerTrait;
use std::io::{self, Read, Seek, Cursor, Write, SeekFrom};
use std::default::Default;

use mime::{Mime, TopLevel, SubLevel, Attr, Value};
use oauth2;
Expand Down
11 changes: 5 additions & 6 deletions src/rust/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ mod tests {
use self::hyper_mock::*;
use std::io::Read;
use std::default::Default;
use std::old_path::BytesContainer;

const EXPECTED: &'static str =
"\r\n--MDuXWGyeE33QFXGchb2VFWc4Z7945d\r\n\
Expand All @@ -40,8 +39,8 @@ bar\r\n\
let mut r2 = MockStream::with_input(b"bar");
let mut mpr: MultiPartReader = Default::default();

mpr.add_part(&mut r1, 50, &"application/json".parse().unwrap())
.add_part(&mut r2, 25, &"application/plain".parse().unwrap());
mpr.add_part(&mut r1, 50, "application/json".parse().unwrap())
.add_part(&mut r2, 25, "application/plain".parse().unwrap());

let mut res = String::new();
let r = mpr.read_to_string(&mut res);
Expand All @@ -51,8 +50,8 @@ bar\r\n\
// As the test is just for dev, and doesn't run on travis, we are fine,
// for now. Possible solution would be to omit the size field (make it
// optional)
// assert_eq!(res, EXPECTED);
assert_eq!(r, Ok(EXPECTED_LEN));
// assert_eq!(res, EXPECTED);
}

#[test]
Expand All @@ -61,8 +60,8 @@ bar\r\n\
let mut r2 = MockStream::with_input(b"bar");
let mut mpr: MultiPartReader = Default::default();

mpr.add_part(&mut r1, 50, &"application/json".parse().unwrap())
.add_part(&mut r2, 25, &"application/plain".parse().unwrap());
mpr.add_part(&mut r1, 50, "application/json".parse().unwrap())
.add_part(&mut r2, 25, "application/plain".parse().unwrap());

let mut buf = &mut [0u8];
let mut v = Vec::<u8>::new();
Expand Down

0 comments on commit 6b23013

Please sign in to comment.