From 3482e1c4534a2cb6d1897fac8f692ab60fbaa979 Mon Sep 17 00:00:00 2001 From: John Gallagher Date: Tue, 15 Dec 2015 13:39:47 -0500 Subject: [PATCH] Add unit test confirming write_all to a Blob fails if given too much data. --- src/blob.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/blob.rs b/src/blob.rs index 520280e..e8e7851 100644 --- a/src/blob.rs +++ b/src/blob.rs @@ -289,6 +289,11 @@ mod test { assert!(blob.seek(SeekFrom::Current(-20)).is_err()); assert!(blob.seek(SeekFrom::End(0)).is_ok()); assert!(blob.seek(SeekFrom::Current(1)).is_err()); + + // write_all should detect when we return Ok(0) because there is no space left, + // and return a write error + blob.reopen(rowid).unwrap(); + assert!(blob.write_all(b"0123456789x").is_err()); } #[test]