changeset 153:c4b748594ad6

Uncomment parts of a block test for reverse iteration.
author Lewin Bormann <lbo@spheniscida.de>
date Sat, 18 Feb 2017 09:48:09 +0100
parents ffd4237fd415
children c4b97788d886
files src/block.rs
diffstat 1 files changed, 13 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/block.rs	Sat Feb 04 09:27:10 2017 +0100
+++ b/src/block.rs	Sat Feb 18 09:48:09 2017 +0100
@@ -479,19 +479,19 @@
         let block_contents = builder.finish();
         let mut block = Block::new(o.clone(), block_contents).iter();
 
-        // assert!(!block.valid());
-        // assert_eq!(block.next(),
-        // Some(("key1".as_bytes().to_vec(), "value1".as_bytes().to_vec())));
-        // assert!(block.valid());
-        // block.next();
-        // assert!(block.valid());
-        // block.prev();
-        // assert!(block.valid());
-        // assert_eq!(block.current(),
-        // Some(("key1".as_bytes().to_vec(), "value1".as_bytes().to_vec())));
-        // block.prev();
-        // assert!(!block.valid());
-        //
+        assert!(!block.valid());
+        assert_eq!(block.next(),
+                   Some(("key1".as_bytes().to_vec(), "value1".as_bytes().to_vec())));
+        assert!(block.valid());
+        block.next();
+        assert!(block.valid());
+        block.prev();
+        assert!(block.valid());
+        assert_eq!(block.current(),
+                   Some(("key1".as_bytes().to_vec(), "value1".as_bytes().to_vec())));
+        block.prev();
+        assert!(!block.valid());
+
         // Verify that prev() from the last entry goes to the prev-to-last entry
         // (essentially, that next() returning None doesn't advance anything)
         while let Some(_) = block.next() {