Skip to content

Commit

Permalink
fix: adjust tests to new Rust version (#259)
Browse files Browse the repository at this point in the history
- Adjust forget unit tests: Make timestamps unique
- Apply clippy hint
  • Loading branch information
aawsome authored Sep 6, 2024
1 parent 10ce882 commit ed3d5ae
Show file tree
Hide file tree
Showing 46 changed files with 772 additions and 773 deletions.
34 changes: 17 additions & 17 deletions crates/core/src/commands/forget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,23 +672,23 @@ mod tests {
];

let by_date_and_tag = [
("2014-10-01 10:20:30", "foo"),
("2014-10-02 10:20:30", "foo"),
("2014-10-05 10:20:30", "foo"),
("2014-10-06 10:20:30", "foo"),
("2014-10-08 10:20:30", "foo"),
("2014-10-09 10:20:30", "foo"),
("2014-10-10 10:20:30", "foo"),
("2014-10-11 10:20:30", "foo"),
("2014-10-20 10:20:30", "foo"),
("2014-10-22 10:20:30", "foo"),
("2014-11-08 10:20:30", "foo"),
("2014-11-10 10:20:30", "foo"),
("2014-11-12 10:20:30", "foo"),
("2014-11-13 10:20:30", "foo"),
("2014-11-15 10:20:30", "foo,bar"),
("2015-10-22 10:20:30", "foo,bar"),
("2015-10-22 10:20:30", "foo,bar"),
("2014-10-01 10:20:31", "foo"),
("2014-10-02 10:20:31", "foo"),
("2014-10-05 10:20:31", "foo"),
("2014-10-06 10:20:31", "foo"),
("2014-10-08 10:20:31", "foo"),
("2014-10-09 10:20:31", "foo"),
("2014-10-10 10:20:31", "foo"),
("2014-10-11 10:20:31", "foo"),
("2014-10-20 10:20:31", "foo"),
("2014-10-22 10:20:31", "foo"),
("2014-11-08 10:20:31", "foo"),
("2014-11-10 10:20:31", "foo"),
("2014-11-12 10:20:31", "foo"),
("2014-11-13 10:20:31", "foo"),
("2014-11-15 10:20:31", "foo,bar"),
("2015-10-22 10:20:31", "foo,bar"),
("2015-10-22 10:20:31", "foo,bar"),
];

let delete_never = ["2014-09-01 10:25:37"];
Expand Down
3 changes: 1 addition & 2 deletions crates/core/src/commands/prune.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1215,9 +1215,8 @@ impl PrunePlan {
let packs: Vec<_> = self
.index_files
.into_iter()
.map(|index| {
.inspect(|index| {
indexes_remove.push(index.id);
index
})
.flat_map(|index| index.packs)
.collect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ ForgetResult([
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
Expand Down Expand Up @@ -87,21 +87,21 @@ ForgetResult([
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-11-15T10:20:31Z", false, []),
("2014-11-13T10:20:31Z", false, []),
("2014-11-12T10:20:31Z", false, []),
("2014-11-10T10:20:31Z", false, []),
("2014-11-08T10:20:31Z", false, []),
("2014-10-22T10:20:31Z", false, []),
("2014-10-20T10:20:31Z", false, []),
("2014-10-11T10:20:31Z", false, []),
("2014-10-10T10:20:31Z", false, []),
("2014-10-09T10:20:31Z", false, []),
("2014-10-08T10:20:31Z", false, []),
("2014-10-06T10:20:31Z", false, []),
("2014-10-05T10:20:31Z", false, []),
("2014-10-02T10:20:31Z", false, []),
("2014-10-01T10:20:31Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ ForgetResult([
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", true, [
("2015-10-22T10:20:31Z", true, [
"monthly",
]),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
Expand Down Expand Up @@ -84,21 +84,21 @@ ForgetResult([
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-11-15T10:20:31Z", false, []),
("2014-11-13T10:20:31Z", false, []),
("2014-11-12T10:20:31Z", false, []),
("2014-11-10T10:20:31Z", false, []),
("2014-11-08T10:20:31Z", false, []),
("2014-10-22T10:20:31Z", false, []),
("2014-10-20T10:20:31Z", false, []),
("2014-10-11T10:20:31Z", false, []),
("2014-10-10T10:20:31Z", false, []),
("2014-10-09T10:20:31Z", false, []),
("2014-10-08T10:20:31Z", false, []),
("2014-10-06T10:20:31Z", false, []),
("2014-10-05T10:20:31Z", false, []),
("2014-10-02T10:20:31Z", false, []),
("2014-10-01T10:20:31Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ ForgetResult([
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", true, [
("2015-10-22T10:20:31Z", true, [
"monthly",
]),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
Expand Down Expand Up @@ -89,23 +89,23 @@ ForgetResult([
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", true, [
("2014-11-15T10:20:31Z", false, []),
("2014-11-13T10:20:31Z", false, []),
("2014-11-12T10:20:31Z", false, []),
("2014-11-10T10:20:31Z", false, []),
("2014-11-08T10:20:31Z", false, []),
("2014-10-22T10:20:31Z", true, [
"monthly",
]),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-10-20T10:20:31Z", false, []),
("2014-10-11T10:20:31Z", false, []),
("2014-10-10T10:20:31Z", false, []),
("2014-10-09T10:20:31Z", false, []),
("2014-10-08T10:20:31Z", false, []),
("2014-10-06T10:20:31Z", false, []),
("2014-10-05T10:20:31Z", false, []),
("2014-10-02T10:20:31Z", false, []),
("2014-10-01T10:20:31Z", false, []),
("2014-09-22T10:20:30Z", true, [
"monthly",
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ ForgetResult([
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
Expand Down Expand Up @@ -78,21 +78,21 @@ ForgetResult([
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-11-15T10:20:31Z", false, []),
("2014-11-13T10:20:31Z", false, []),
("2014-11-12T10:20:31Z", false, []),
("2014-11-10T10:20:31Z", false, []),
("2014-11-08T10:20:31Z", false, []),
("2014-10-22T10:20:31Z", false, []),
("2014-10-20T10:20:31Z", false, []),
("2014-10-11T10:20:31Z", false, []),
("2014-10-10T10:20:31Z", false, []),
("2014-10-09T10:20:31Z", false, []),
("2014-10-08T10:20:31Z", false, []),
("2014-10-06T10:20:31Z", false, []),
("2014-10-05T10:20:31Z", false, []),
("2014-10-02T10:20:31Z", false, []),
("2014-10-01T10:20:31Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ ForgetResult([
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
Expand Down Expand Up @@ -73,21 +73,21 @@ ForgetResult([
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-11-15T10:20:31Z", false, []),
("2014-11-13T10:20:31Z", false, []),
("2014-11-12T10:20:31Z", false, []),
("2014-11-10T10:20:31Z", false, []),
("2014-11-08T10:20:31Z", false, []),
("2014-10-22T10:20:31Z", false, []),
("2014-10-20T10:20:31Z", false, []),
("2014-10-11T10:20:31Z", false, []),
("2014-10-10T10:20:31Z", false, []),
("2014-10-09T10:20:31Z", false, []),
("2014-10-08T10:20:31Z", false, []),
("2014-10-06T10:20:31Z", false, []),
("2014-10-05T10:20:31Z", false, []),
("2014-10-02T10:20:31Z", false, []),
("2014-10-01T10:20:31Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ ForgetResult([
("2015-11-08T10:20:30Z", true, [
"daily",
]),
("2015-10-22T10:20:30Z", true, [
("2015-10-22T10:20:31Z", true, [
"daily",
]),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", true, [
Expand Down Expand Up @@ -127,21 +127,21 @@ ForgetResult([
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-11-15T10:20:31Z", false, []),
("2014-11-13T10:20:31Z", false, []),
("2014-11-12T10:20:31Z", false, []),
("2014-11-10T10:20:31Z", false, []),
("2014-11-08T10:20:31Z", false, []),
("2014-10-22T10:20:31Z", false, []),
("2014-10-20T10:20:31Z", false, []),
("2014-10-11T10:20:31Z", false, []),
("2014-10-10T10:20:31Z", false, []),
("2014-10-09T10:20:31Z", false, []),
("2014-10-08T10:20:31Z", false, []),
("2014-10-06T10:20:31Z", false, []),
("2014-10-05T10:20:31Z", false, []),
("2014-10-02T10:20:31Z", false, []),
("2014-10-01T10:20:31Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ ForgetResult([
("2015-11-12T10:20:30Z", false, []),
("2015-11-10T10:20:30Z", false, []),
("2015-11-08T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", true, [
("2015-10-22T10:20:31Z", true, [
"monthly",
]),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:31Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-22T10:20:30Z", false, []),
("2015-10-20T10:20:30Z", false, []),
Expand Down Expand Up @@ -92,21 +92,21 @@ ForgetResult([
("2014-11-21T10:20:30Z", false, []),
("2014-11-20T10:20:30Z", false, []),
("2014-11-18T10:20:30Z", false, []),
("2014-11-15T10:20:30Z", false, []),
("2014-11-13T10:20:30Z", false, []),
("2014-11-12T10:20:30Z", false, []),
("2014-11-10T10:20:30Z", false, []),
("2014-11-08T10:20:30Z", false, []),
("2014-10-22T10:20:30Z", false, []),
("2014-10-20T10:20:30Z", false, []),
("2014-10-11T10:20:30Z", false, []),
("2014-10-10T10:20:30Z", false, []),
("2014-10-09T10:20:30Z", false, []),
("2014-10-08T10:20:30Z", false, []),
("2014-10-06T10:20:30Z", false, []),
("2014-10-05T10:20:30Z", false, []),
("2014-10-02T10:20:30Z", false, []),
("2014-10-01T10:20:30Z", false, []),
("2014-11-15T10:20:31Z", false, []),
("2014-11-13T10:20:31Z", false, []),
("2014-11-12T10:20:31Z", false, []),
("2014-11-10T10:20:31Z", false, []),
("2014-11-08T10:20:31Z", false, []),
("2014-10-22T10:20:31Z", false, []),
("2014-10-20T10:20:31Z", false, []),
("2014-10-11T10:20:31Z", false, []),
("2014-10-10T10:20:31Z", false, []),
("2014-10-09T10:20:31Z", false, []),
("2014-10-08T10:20:31Z", false, []),
("2014-10-06T10:20:31Z", false, []),
("2014-10-05T10:20:31Z", false, []),
("2014-10-02T10:20:31Z", false, []),
("2014-10-01T10:20:31Z", false, []),
("2014-09-22T10:20:30Z", false, []),
("2014-09-20T10:20:30Z", false, []),
("2014-09-11T10:20:30Z", false, []),
Expand Down
Loading

0 comments on commit ed3d5ae

Please sign in to comment.