Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1802,13 +1802,11 @@ mod tests {
// * metadata enables the optional dependency for docs.rs
// * `cargo doc` fails with the version of the dependency in the lockfile
// * there is a newer version of the dependency available that correctly builds
let crate_ = "docs_rs_test_incorrect_lockfile";
let version = "0.1.2";
let mut builder = RustwideBuilder::init(&env.context).unwrap();
builder.update_toolchain()?;
assert!(
builder
.build_package(crate_, version, PackageKind::CratesIo, false)?
.build_local_package(Path::new("tests/crates/incorrect_lockfile_0_1"))?
.successful
);

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

Expand Down
16 changes: 16 additions & 0 deletions tests/crates/incorrect_lockfile_0_1/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions tests/crates/incorrect_lockfile_0_1/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "docs_rs_test_incorrect_lockfile"
version = "0.1.2"
edition = "2021"
description = """
Test crate for docs.rs build tests
"""
license = "MIT OR Apache-2.0"

[dependencies]
rand_core.version = "0.5"
rand_core.optional = true

[package.metadata.docs.rs]
features = ["rand_core"]
1 change: 1 addition & 0 deletions tests/crates/incorrect_lockfile_0_1/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub const _: u32 = rand_core::Error::INTERNAL_START;
Empty file.
95 changes: 95 additions & 0 deletions tests/crates/incorrect_lockfile_0_2/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions tests/crates/incorrect_lockfile_0_2/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "docs_rs_test_incorrect_lockfile"
version = "0.2.0"
edition = "2021"
description = """
Test crate for docs.rs build tests
"""
license = "MIT OR Apache-2.0"

[dependencies]
log.version = "0.4.17"
log.features = ["kv_unstable_sval"]
Empty file.
Empty file.
Loading