Skip to content

Commit 219d334

Browse files
committed
Split out deletion tests
1 parent 4738578 commit 219d334

File tree

2 files changed

+29
-13
lines changed

2 files changed

+29
-13
lines changed

tests/delete.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2015, 2016, 2017, 2019, 2020 Martin Pool.
2+
3+
// This program is free software; you can redistribute it and/or modify
4+
// it under the terms of the GNU General Public License as published by
5+
// the Free Software Foundation; either version 2 of the License, or
6+
// (at your option) any later version.
7+
//
8+
// This program is distributed in the hope that it will be useful,
9+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
// GNU General Public License for more details.
12+
13+
//! Test deletion.
14+
15+
use conserve::test_fixtures::ScratchArchive;
16+
use conserve::*;
17+
18+
#[test]
19+
fn delete_all_bands() {
20+
let af = ScratchArchive::new();
21+
af.store_two_versions();
22+
23+
let stats = af
24+
.delete_bands(&[BandId::new(&[0]), BandId::new(&[1])], &Default::default())
25+
.expect("delete_bands");
26+
27+
assert_eq!(stats.deleted_block_count, 2);
28+
assert_eq!(stats.deleted_band_count, 2);
29+
}

tests/integration.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -381,16 +381,3 @@ pub fn detect_minimal_mtime_change() {
381381
assert_eq!(stats.files, 2);
382382
assert_eq!(stats.unmodified_files, 1);
383383
}
384-
385-
#[test]
386-
fn delete_bands() {
387-
let af = ScratchArchive::new();
388-
af.store_two_versions();
389-
390-
let stats = af
391-
.delete_bands(&[BandId::new(&[0]), BandId::new(&[1])], &Default::default())
392-
.expect("delete_bands");
393-
394-
assert_eq!(stats.deleted_block_count, 2);
395-
assert_eq!(stats.deleted_band_count, 2);
396-
}

0 commit comments

Comments
 (0)