Skip to content

Commit e0c64fd

Browse files
committed
cleanup gix-ref-tests
1 parent 01c6ef6 commit e0c64fd

File tree

18 files changed

+38
-70
lines changed

18 files changed

+38
-70
lines changed

Cargo.lock

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gix-ref/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ document-features = { version = "0.2.1", optional = true }
4141

4242
[dev-dependencies]
4343
gix-testtools = { path = "../tests/tools" }
44-
gix-utils = { path = "../gix-utils" }
45-
tempfile = "3.2.0"
4644

4745

4846
[package.metadata.docs.rs]

gix-ref/src/store/file/loose/reflog/create_or_update/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{convert::TryInto, path::Path};
33
use gix_actor::Signature;
44
use gix_date::{time::Sign, Time};
55
use gix_object::bstr::ByteSlice;
6-
use tempfile::TempDir;
6+
use gix_testtools::tempfile::TempDir;
77

88
use super::*;
99
use crate::{file::WriteReflog, FullNameRef};

gix-ref/tests/Cargo.toml

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,44 +4,29 @@ version = "0.0.0"
44
publish = false
55
repository = "https://github.com/Byron/gitoxide"
66
license = "MIT OR Apache-2.0"
7-
description = "Please use `gix-<thiscrate>` instead ('git' -> 'gix')"
7+
description = "Test the gix-ref crate with feature toggles"
88
authors = ["Sebastian Thiel <[email protected]>"]
99
edition = "2021"
10-
include = ["src/**/*"]
1110
rust-version = "1.65"
1211

1312
[features]
14-
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
15-
serde= ["gix-ref/serde"]
16-
internal-testing-gix-features-parallel = ["gix-features/parallel"] # test sorted parallel loose file traversal
13+
gix-features-parallel = ["gix-features/parallel"] # test sorted parallel loose file traversal
14+
serde = ["gix-ref/serde"]
1715

1816
[[test]]
19-
name = "refs-single-threaded"
17+
name = "refs"
2018
path = "refs.rs"
21-
required-features = []
22-
23-
[[test]]
24-
name = "refs-parallel-fs-traversal"
25-
path = "refs-parallel.rs"
26-
required-features = ["internal-testing-gix-features-parallel"]
2719

2820
[dev-dependencies]
2921
gix-ref = { path = ".." }
3022
gix-fs = { path = "../../gix-fs" }
3123
gix-features = { path = "../../gix-features", features = ["walkdir"]}
3224
gix-testtools = { path = "../../tests/tools" }
3325
gix-discover = { path = "../../gix-discover" }
34-
gix-worktree = { path = "../../gix-worktree" }
3526
gix-odb = { path = "../../gix-odb" }
3627
gix-actor = { path = "../../gix-actor" }
3728
gix-date = { path = "../../gix-date" }
3829
gix-hash = { path = "../../gix-hash" }
3930
gix-validate = { path = "../../gix-validate" }
4031
gix-lock = { path = "../../gix-lock" }
4132
gix-object = { path = "../../gix-object" }
42-
tempfile = "3.2.0"
43-
44-
45-
[package.metadata.docs.rs]
46-
features = ["document-features", "serde"]
47-
rustdoc-args = ["--cfg", "docsrs"]

gix-ref/tests/file/log.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ mod iter {
9292
mod with_buffer_big_enough_for_largest_line {
9393
use gix_ref::log::Line;
9494

95-
use crate::util::hex_to_id;
95+
use crate::hex_to_id;
9696

9797
#[test]
9898
fn single_line() -> crate::Result {

gix-ref/tests/file/reference.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ mod peel {
5050
use gix_odb::pack::Find;
5151
use gix_ref::{file::ReferenceExt, peel, Reference};
5252

53-
use crate::{file, file::store_with_packed_refs, util::hex_to_id};
53+
use crate::{file, file::store_with_packed_refs, hex_to_id};
5454

5555
#[test]
5656
fn one_level() -> crate::Result {
@@ -182,7 +182,7 @@ mod parse {
182182
use gix_object::bstr::ByteSlice;
183183
use gix_ref::file::loose::Reference;
184184

185-
use crate::util::hex_to_id;
185+
use crate::hex_to_id;
186186

187187
macro_rules! mktest {
188188
($name:ident, $input:literal, $kind:path, $id:expr, $ref:expr) => {

gix-ref/tests/file/store/find.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ mod existing {
33

44
use gix_ref::{PartialName, PartialNameRef};
55

6-
use crate::{file::store_at, util::hex_to_id};
6+
use crate::{file::store_at, hex_to_id};
77

88
#[test]
99
fn with_packed_refs() -> crate::Result {
@@ -90,7 +90,7 @@ mod existing {
9090
}
9191

9292
mod loose {
93-
use crate::{file::store, util::hex_to_id};
93+
use crate::{file::store, hex_to_id};
9494

9595
mod existing {
9696
use std::path::Path;

gix-ref/tests/file/store/iter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use gix_object::bstr::ByteSlice;
44

55
use crate::{
66
file::{store, store_at, store_with_packed_refs},
7-
util::hex_to_id,
7+
hex_to_id,
88
};
99

1010
mod with_namespace {

gix-ref/tests/file/transaction/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub(crate) mod prepare_and_commit {
1010
Target,
1111
};
1212

13-
use crate::util::hex_to_id;
13+
use crate::hex_to_id;
1414

1515
fn reflog_lines(store: &file::Store, name: &str) -> crate::Result<Vec<gix_ref::log::Line>> {
1616
let mut buf = Vec::new();
@@ -22,8 +22,8 @@ pub(crate) mod prepare_and_commit {
2222
Ok(res)
2323
}
2424

25-
pub(crate) fn empty_store() -> crate::Result<(tempfile::TempDir, file::Store)> {
26-
let dir = tempfile::TempDir::new().unwrap();
25+
pub(crate) fn empty_store() -> crate::Result<(gix_testtools::tempfile::TempDir, file::Store)> {
26+
let dir = gix_testtools::tempfile::TempDir::new().unwrap();
2727
let store = file::Store::at(dir.path(), gix_ref::store::WriteReflog::Normal, gix_hash::Kind::Sha1);
2828
Ok((dir, store))
2929
}

gix-ref/tests/file/transaction/prepare_and_commit/create_or_update/collisions.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use gix_ref::{
99

1010
use crate::{
1111
file::transaction::prepare_and_commit::{committer, create_at, create_symbolic_at, delete_at, empty_store},
12-
util::hex_to_id,
12+
hex_to_id,
1313
};
1414

1515
fn case_sensitive(tmp_dir: &std::path::Path) -> bool {

0 commit comments

Comments
 (0)