Skip to content

Commit

Permalink
Fix dvec-related fallout in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Mar 8, 2013
1 parent 59de385 commit 62651df
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 53 deletions.
8 changes: 3 additions & 5 deletions src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1442,17 +1442,15 @@ mod tests {
fn bytes_buffer_overwrite() {
let wr = BytesWriter();
wr.write(~[0u8, 1u8, 2u8, 3u8]);
fail_unless!(wr.bytes.borrow(|bytes| bytes == ~[0u8, 1u8, 2u8, 3u8]));
fail_unless!(wr.bytes == ~[0u8, 1u8, 2u8, 3u8]);
wr.seek(-2, SeekCur);
wr.write(~[4u8, 5u8, 6u8, 7u8]);
fail_unless!(wr.bytes.borrow(|bytes| bytes ==
~[0u8, 1u8, 4u8, 5u8, 6u8, 7u8]));
fail_unless!(wr.bytes == ~[0u8, 1u8, 4u8, 5u8, 6u8, 7u8]);
wr.seek(-2, SeekEnd);
wr.write(~[8u8]);
wr.seek(1, SeekSet);
wr.write(~[9u8]);
fail_unless!(wr.bytes.borrow(|bytes| bytes ==
~[0u8, 9u8, 4u8, 5u8, 8u8, 7u8]));
fail_unless!(wr.bytes == ~[0u8, 9u8, 4u8, 5u8, 8u8, 7u8]);
}
#[test]
Expand Down
15 changes: 6 additions & 9 deletions src/libstd/flatpipes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,13 +452,10 @@ pub mod flatteners {
pub fn serialize_value<D: Encoder + FromWriter,
T: Encodable<D>>(val: &T) -> ~[u8] {
let mut bytes_writer = BytesWriter();
let writer = @bytes_writer as @Writer;
let ser = FromWriter::from_writer(writer);
val.encode(&ser);
let mut ret = ~[];
ret <-> bytes_writer.bytes;
return ret;
do io::with_bytes_writer |writer| {
let ser = FromWriter::from_writer(writer);
val.encode(&ser);
}
}
pub trait FromReader {
Expand Down Expand Up @@ -652,7 +649,7 @@ mod test {
chan.send(10);
let bytes = chan.byte_chan.writer.bytes.get();
let bytes = copy chan.byte_chan.writer.bytes;
let reader = BufReader::new(bytes);
let port = serial::reader_port(reader);
Expand Down Expand Up @@ -698,7 +695,7 @@ mod test {
chan.send(10);
let bytes = chan.byte_chan.writer.bytes.get();
let bytes = copy chan.byte_chan.writer.bytes;
let reader = BufReader::new(bytes);
let port = pod::reader_port(reader);
Expand Down
9 changes: 3 additions & 6 deletions src/libstd/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,8 +1311,7 @@ mod tests {
}
}
}
check_equal(str::from_bytes(bw.bytes.data),
~"[\"frog\",[\"Henry\",349]]");
check_equal(str::from_bytes(bw.bytes), ~"[\"frog\",[\"Henry\",349]]");
}
#[test]
Expand All @@ -1327,8 +1326,7 @@ mod tests {
}
}
}
check_equal(str::from_bytes(bw.bytes.data),
~"\"jodhpurs\"");
check_equal(str::from_bytes(bw.bytes), ~"\"jodhpurs\"");
}

#[test]
Expand All @@ -1340,8 +1338,7 @@ mod tests {
do encoder.emit_enum_variant (~"None",37,1242) {
}
}
check_equal(str::from_bytes(bw.bytes.data),
~"null");
check_equal(str::from_bytes(bw.bytes), ~"null");
}
#[test]
Expand Down
6 changes: 3 additions & 3 deletions src/libsyntax/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ mod test {
use util::testing::*;

#[test] fn to_json_str (val: Encodable<std::json::Encoder>) -> ~str {
let bw = @io::BytesWriter();
val.encode(~std::json::Encoder(bw as io::Writer));
str::from_bytes(bw.bytes.data)
do io::with_str_writer |writer| {
val.encode(~std::json::Encoder(writer));
}
}

#[test] fn alltts () {
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/call-closure-from-overloaded-op.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
fn foo() -> int { 22 }

pub fn main() {
let x: ~[@fn() -> int] = ~[];
let mut x: ~[@fn() -> int] = ~[];
x.push(foo);
fail_unless!((x[0])() == 22);
}
3 changes: 1 addition & 2 deletions src/test/run-pass/issue-2631-b.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ extern mod req;
extern mod std;

use req::*;
use std::oldmap::*;
use std::oldmap::HashMap;

pub fn main() {
let v = ~[@~"hi"];
let m: req::header_map = HashMap();
m.insert(~"METHOD", @mut ~[v]);
m.insert(~"METHOD", @mut v);
request::<int>(m);
}
Binary file removed src/test/run-pass/issue-5275
Binary file not shown.
27 changes: 0 additions & 27 deletions src/test/run-pass/issue-5275.rs

This file was deleted.

5 comments on commit 62651df

@bors
Copy link
Contributor

@bors bors commented on 62651df Mar 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from pcwalton
at alexcrichton@62651df

@bors
Copy link
Contributor

@bors bors commented on 62651df Mar 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging alexcrichton/rust/no-dvec = 62651df into auto

@bors
Copy link
Contributor

@bors bors commented on 62651df Mar 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alexcrichton/rust/no-dvec = 62651df merged ok, testing candidate = 3bbcac3

@bors
Copy link
Contributor

@bors bors commented on 62651df Mar 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 62651df Mar 8, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding incoming to auto = 3bbcac3

Please sign in to comment.