Skip to content

Commit

Permalink
UT: tested writing into a too small buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
3Hren committed Jul 26, 2015
1 parent d0c1bc0 commit 4c37608
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/func/encode/value_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ fn pack_nil() {

assert_eq!([0xc0], buf);
}

#[test]
fn pack_nil_when_buffer_is_tool_small() {
let mut buf = [];

let val = ValueRef::Nil;

match write_value_ref(&mut &mut buf[..], &val) {
Err(..) => (),
other => panic!("unexpected result: {:?}", other)
}
}

0 comments on commit 4c37608

Please sign in to comment.