aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-10-29 14:04:10 -0700
committerBryan Newbold <bnewbold@robocracy.org>2017-10-29 14:04:10 -0700
commit4a87b60ecf2f5e558235c41c8929ce264830c147 (patch)
tree09196df09cf4b35104317a3e631f21aa2c655ff2
parent58a0dc3387cfc88991bd93fad6d16a84bd7e4902 (diff)
downloadgeniza-4a87b60ecf2f5e558235c41c8929ce264830c147.tar.gz
geniza-4a87b60ecf2f5e558235c41c8929ce264830c147.zip
add checks/verify to sleep reg tests (verify still broken)
-rw-r--r--src/sleep_register.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/sleep_register.rs b/src/sleep_register.rs
index 8d9d99e..668bb62 100644
--- a/src/sleep_register.rs
+++ b/src/sleep_register.rs
@@ -538,6 +538,8 @@ fn test_sdr_open() {
SleepDirRegister::open(Path::new("test-data/dat/simple/.dat/"), "metadata", false).unwrap();
// Values from 'dat log'
+ assert!(sdr.check().is_ok());
+ // XXX: assert!(sdr.verify().is_ok());
assert_eq!(sdr.len().unwrap(), 3);
assert_eq!(sdr.len_bytes().unwrap(), 145);
@@ -545,6 +547,8 @@ fn test_sdr_open() {
SleepDirRegister::open(Path::new("test-data/dat/simple/.dat/"), "content", false).unwrap();
// Values from 'dat log'
+ assert!(sdr.check().is_ok());
+ // XXX: assert!(sdr.verify().is_ok());
assert_eq!(sdr.len().unwrap(), 2);
assert_eq!(sdr.len_bytes().unwrap(), 204);
}
@@ -566,16 +570,16 @@ fn test_sdr_append() {
let mut sdr = SleepDirRegister::create(tmp_dir.path(), "dummy").unwrap();
sdr.append("hello world!".as_bytes()).unwrap();
- sdr.check().unwrap();
- sdr.verify().unwrap();
+ assert!(sdr.check().is_ok());
+ assert!(sdr.verify().is_ok());
assert_eq!(sdr.len().unwrap(), 1);
assert_eq!(sdr.len_bytes().unwrap(), 12);
let count = 100; // TODO: make this >1000 when things are faster
for _ in 0..count {
sdr.append(&[1, 2, 3, 4, 5]).unwrap();
}
- sdr.check().unwrap();
- sdr.verify().unwrap();
+ assert!(sdr.check().is_ok());
+ assert!(sdr.verify().is_ok());
assert_eq!(sdr.len().unwrap(), 1 + count);
assert_eq!(sdr.len_bytes().unwrap(), 12 + (count * 5));
}
@@ -587,7 +591,7 @@ fn test_sdr_has() {
let mut sdr = SleepDirRegister::create(tmp_dir.path(), "dummy").unwrap();
sdr.append("hello world!".as_bytes()).unwrap();
- sdr.check().unwrap();
+ assert!(sdr.check().is_ok());
assert_eq!(sdr.has_all().unwrap(), true);
assert_eq!(sdr.has(0).unwrap(), true);
assert_eq!(sdr.has(40).unwrap(), false);