Skip to content

Commit cdf47ec

Browse files
sypharGuillaumeGomez
authored andcommitted
move test-crate for incorrect-lockfile tests into repo
1 parent 737cbeb commit cdf47ec

File tree

9 files changed

+141
-6
lines changed

9 files changed

+141
-6
lines changed

src/docbuilder/rustwide_builder.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1802,13 +1802,11 @@ mod tests {
18021802
// * metadata enables the optional dependency for docs.rs
18031803
// * `cargo doc` fails with the version of the dependency in the lockfile
18041804
// * there is a newer version of the dependency available that correctly builds
1805-
let crate_ = "docs_rs_test_incorrect_lockfile";
1806-
let version = "0.1.2";
18071805
let mut builder = RustwideBuilder::init(&env.context).unwrap();
18081806
builder.update_toolchain()?;
18091807
assert!(
18101808
builder
1811-
.build_package(crate_, version, PackageKind::CratesIo, false)?
1809+
.build_local_package(Path::new("tests/crates/incorrect_lockfile_0_1"))?
18121810
.successful
18131811
);
18141812

@@ -1831,13 +1829,11 @@ mod tests {
18311829
// lockfile, but generating a new working lockfile requires
18321830
// introducing a completely new dependency (not just version) which
18331831
// would not have had its details pulled down from the sparse-index.
1834-
let crate_ = "docs_rs_test_incorrect_lockfile";
1835-
let version = "0.2.0";
18361832
let mut builder = RustwideBuilder::init(&env.context).unwrap();
18371833
builder.update_toolchain()?;
18381834
assert!(
18391835
builder
1840-
.build_package(crate_, version, PackageKind::CratesIo, false)?
1836+
.build_local_package(Path::new("tests/crates/incorrect_lockfile_0_2"))?
18411837
.successful
18421838
);
18431839

tests/crates/incorrect_lockfile_0_1/Cargo.lock

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "docs_rs_test_incorrect_lockfile"
3+
version = "0.1.2"
4+
edition = "2021"
5+
description = """
6+
Test crate for docs.rs build tests
7+
"""
8+
license = "MIT OR Apache-2.0"
9+
10+
[dependencies]
11+
rand_core.version = "0.5"
12+
rand_core.optional = true
13+
14+
[package.metadata.docs.rs]
15+
features = ["rand_core"]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub const _: u32 = rand_core::Error::INTERNAL_START;

tests/crates/incorrect_lockfile_0_1/src/main.rs

Whitespace-only changes.

tests/crates/incorrect_lockfile_0_2/Cargo.lock

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[package]
2+
name = "docs_rs_test_incorrect_lockfile"
3+
version = "0.2.0"
4+
edition = "2021"
5+
description = """
6+
Test crate for docs.rs build tests
7+
"""
8+
license = "MIT OR Apache-2.0"
9+
10+
[dependencies]
11+
log.version = "0.4.17"
12+
log.features = ["kv_unstable_sval"]

tests/crates/incorrect_lockfile_0_2/src/lib.rs

Whitespace-only changes.

tests/crates/incorrect_lockfile_0_2/src/main.rs

Whitespace-only changes.

0 commit comments

Comments
 (0)