Add tests for blob_fname failing cases
This commit is contained in:
parent
39bc39ddd5
commit
a1d02d4154
|
@ -667,6 +667,23 @@ mod test {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bad_blob_fnames() -> Result<()> {
|
||||
let (_tmp_dir, store) = new_empty()?;
|
||||
|
||||
assert!(store.blob_fname("abcd").is_ok());
|
||||
assert!(store.blob_fname("abcd..").is_ok());
|
||||
assert!(store.blob_fname("..abcd..").is_ok());
|
||||
assert!(store.blob_fname(".abcd").is_ok());
|
||||
|
||||
assert!(store.blob_fname(".").is_err());
|
||||
assert!(store.blob_fname("..").is_err());
|
||||
assert!(store.blob_fname("../abcd").is_err());
|
||||
assert!(store.blob_fname("/abcd").is_err());
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn blobs() -> Result<()> {
|
||||
let (tmp_dir, mut store) = new_empty()?;
|
||||
|
|
Loading…
Reference in New Issue